Crate hir_def

Source
Expand description

hir_def crate contains everything between macro expansion and type inference.

It defines various items (structs, enums, traits) which comprises Rust code, as well as an algorithm for resolving paths to such entities.

Note that hir_def is a work in progress, so not all of the above is actually true.

Re-exports§

pub use self::hir::type_ref;
pub use rustc_abi as layout;
pub use rustc_abi as layout;
pub use crate::signatures::LocalFieldId;
pub use rustc_abi as layout;

Modules§

attr
A higher level attributes based on TokenTree, with also some shortcuts.
builtin_type
This module defines built-in types.
db
Defines database & queries for name resolution.
dyn_map
This module defines a DynMap – a container for heterogeneous maps.
expr_store
Defines ExpressionStore: a lowered representation of functions, statics and consts.
find_path
An algorithm to find a path to refer to a certain item.
hir
This module describes hir-level representation of expressions.
import_map
A map of all publicly exported items in a crate.
item_scope
Describes items defined or visible (ie, imported) in a certain scope. This is shared between modules and blocks.
item_tree
A simplified AST that only contains items.
lang_item
Collects lang items: items marked with #[lang = "..."] attribute.
nameres
This module implements import-resolution/macro expansion algorithm.
per_ns
In rust, it is possible to have a value, a type and a macro with the same name without conflicts.
resolver
Name resolution façade.
signatures
Item signature IR definitions
src
Utilities for mapping between hir IDs and the surface syntax.
tt
visibility
Defines hir-level representation of visibility (e.g. pub and pub(crate)).

Structs§

AssocItemLoc
BlockId
BlockLoc
ConstId
ConstParamId
A TypeOrConstParamId with an invariant that it actually belongs to a const
CrateRootModuleId
A ModuleId that is always a crate’s root module.
EnumId
EnumVariantId
EnumVariantLoc
ExternBlockId
ExternCrateId
FieldId
FunctionId
ImplId
ImportPathConfig
A wrapper around three booleans
ItemLoc
LifetimeParamId
Macro2Id
Macro2Loc
MacroRulesId
MacroRulesLoc
MacroRulesLocFlags
ModuleId
ProcMacroId
ProcMacroLoc
StaticId
StructId
SyntheticSyntax
TraitId
TupleFieldId
TupleId
TypeAliasId
TypeOrConstParamId
TypeParamId
A TypeOrConstParamId with an invariant that it actually belongs to a type
UnionId
UnresolvedMacro
UseId

Enums§

AdtId
A Data Type
AssocItemId
AttrDefId
CallableDefId
Complete
#[rust_analyzer::completions(...)] options.
DefWithBodyId
The defs which have a body (have root expressions for type inference).
GeneralConstId
A constant, which might appears as a const item, an anonymous const block in expressions or patterns, or as a constant in types with const generics.
GenericDefId
GenericParamId
A generic param
ItemContainerId
MacroExpander
MacroId
A macro
ModuleDefId
The defs which can be visible in the module.
VariantId

Traits§

AstIdLoc
HasModule
Intern
Lookup

Functions§

macro_call_as_call_id

Type Aliases§

EnumLoc
LocalModuleId
An ID of a module, local to a DefMap.
StaticLoc
TraitLoc
UnionLoc