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 extern crate ra_ap_rustc_abi as layout;pub extern crate ra_ap_rustc_abi as rustc_abi;
Re-exports§
pub use crate::find_path::FindPathConfig;pub use crate::hir::type_ref;pub use crate::item_tree::file_item_tree;pub use crate::lang_item::crate_notable_traits;pub use crate::signatures::LocalFieldId;pub use hir_expand::tt;
Modules§
- attrs
- Attributes for anything that is not name resolution.
- builtin_
derive - Definition of builtin derive impls.
- builtin_
type - This module defines built-in types.
- 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.
- tracked_
struct_ 🔒token - unstable_
features - Handling of unstable features.
- upvars
- A simple query to collect tall locals (upvars) a closure use.
- visibility
- Defines hir-level representation of visibility (e.g.
pubandpub(crate)).
Macros§
- impl_
intern 🔒 - impl_
loc 🔒
Structs§
- Assoc
Item Loc - AstId
With 🔒Path - Helper wrapper for
AstIdwithModPath - Block
IdLt - Builtin
Derive Impl Id - Builtin
Derive Impl Loc - ConstId
- Const
Param Id - A TypeOrConstParamId with an invariant that it actually belongs to a const
- EnumId
- Enum
Variant Id - Enum
Variant Loc - Expand
Proc 🔒Attr Macros - Whether to expand procedural macros during name resolution.
- Extern
Block Id - Extern
Crate Id - FieldId
- Function
Id - Hrtb
Lifetime Param Id - ImplId
- ItemLoc
- Lifetime
Param Id - Macro2
Id - Macro2
Loc - Macro
Rules Id - Macro
Rules Loc - Macro
Rules LocFlags - Module
IdLt - Proc
Macro Id - Proc
Macro Loc - Static
Id - Struct
Id - Synthetic
Syntax - Tracked
Struct Token - A token that is required to construct tracked structs. This exists to prevent one from accidentally creating a tracked struct outside of a query which may happen for some codepaths.
- TraitId
- Tuple
Field Id - TupleId
- Type
Alias Id - Type
OrConst Param Id - Type
Param Id - A TypeOrConstParamId with an invariant that it actually belongs to a type
- UnionId
- Unresolved
Macro - UseId
Enums§
- AdtId
- A Data Type
- Assoc
Item Id - Attr
DefId - Callable
DefId - Complete
#[rust_analyzer::completions(...)]options.- DefWith
Body Id - The defs which have a body.
- Expression
Store Owner Id - Owner of an expression store - either a body or a signature.
This is used for queries that operate on expression stores generically,
such as
expr_scopes. - Generic
DefId - Generic
Param Id - A generic param
- Item
Container Id - Lowering
Mode - Macro
Expander - MacroId
- A macro
- Module
DefId - The defs which can be visible in the module.
- Variant
Id