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
andpub(crate)
).
Structs§
- Assoc
Item Loc - BlockId
- Block
Loc - ConstId
- Const
Param Id - A TypeOrConstParamId with an invariant that it actually belongs to a const
- Crate
Root Module Id - A
ModuleId
that is always a crate’s root module. - EnumId
- Enum
Variant Id - Enum
Variant Loc - Extern
Block Id - Extern
Crate Id - FieldId
- Function
Id - ImplId
- Import
Path Config - A wrapper around three booleans
- ItemLoc
- Lifetime
Param Id - Macro2
Id - Macro2
Loc - Macro
Rules Id - Macro
Rules Loc - Macro
Rules LocFlags - Module
Id - Proc
Macro Id - Proc
Macro Loc - Static
Id - Struct
Id - Synthetic
Syntax - 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 (have root expressions for type inference).
- General
Const 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.
- Generic
DefId - Generic
Param Id - A generic param
- Item
Container Id - Macro
Expander - MacroId
- A macro
- Module
DefId - The defs which can be visible in the module.
- Variant
Id
Traits§
Functions§
Type Aliases§
- EnumLoc
- Local
Module Id - An ID of a module, local to a
DefMap
. - Static
Loc - Trait
Loc - Union
Loc