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. pubandpub(crate)).
Structs§
- AssocItem Loc 
- BlockId
- BlockLoc 
- ConstId
- ConstParam Id 
- A TypeOrConstParamId with an invariant that it actually belongs to a const
- CrateRoot Module Id 
- A ModuleIdthat is always a crate’s root module.
- EnumId
- EnumVariant Id 
- EnumVariant Loc 
- ExternBlock Id 
- ExternCrate Id 
- FieldId
- FindPath Config 
- A wrapper around three booleans
- FunctionId 
- ImplId
- ItemLoc
- LifetimeParam Id 
- Macro2Id 
- Macro2Loc 
- MacroRules Id 
- MacroRules Loc 
- MacroRules LocFlags 
- ModuleId 
- ProcMacro Id 
- ProcMacro Loc 
- StaticId 
- StructId 
- SyntheticSyntax 
- TraitId
- TupleField Id 
- TupleId
- TypeAlias Id 
- TypeOrConst Param Id 
- TypeParam Id 
- A TypeOrConstParamId with an invariant that it actually belongs to a type
- UnionId
- UnresolvedMacro 
- UseId
Enums§
- AdtId
- A Data Type
- AssocItem Id 
- AttrDefId 
- CallableDefId 
- Complete
- #[rust_analyzer::completions(...)]options.
- DefWithBody Id 
- The defs which have a body (have root expressions for type inference).
- GeneralConst Id 
- 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 
- GenericParam Id 
- A generic param
- ItemContainer Id 
- MacroExpander 
- MacroId
- A macro
- ModuleDefId 
- The defs which can be visible in the module.
- VariantId 
Traits§
Functions§
Type Aliases§
- EnumLoc
- LocalModule Id 
- An ID of a module, local to a DefMap.
- StaticLoc 
- TraitLoc 
- UnionLoc