Expand description
HIR datatypes. See the rustc dev guide for more info.
Re-exports§
pub use rustc_attr_ir as attrs;pub use hir::*;
Modules§
- arena 🔒
- Declares an arena that can allocate values of any
Copytype, and of any!Copytype listed below. - def
- def_id
- def_
path_ hash_ map - definitions
- For each definition, we track the following data. A definition
here is defined somewhat circularly as “something with a
DefId”, but it generally corresponds to things like structs, enums, etc. There are also some rather random cases (like const initializer expressions) that are mostly just leftovers. - hir 🔒
- intravisit
- HIR walker for walking the contents of nodes.
- lints
- pat_
util - stable_
hash_ 🔒impls - target_
impls 🔒 - Implements conversions from HIR types to Target.
Macros§
- find_
attr - Finds attributes in sequences of attributes by pattern matching.
Structs§
- Arena
- HirId
- Uniquely identifies a node in the HIR of the current crate. It is
composed of the
owner, which is theLocalDefIdof the directly enclosinghir::Item,hir::TraitItem, orhir::ImplItem(i.e., the closest “item-like”), and thelocal_idwhich is unique within the given owner. - Item
Local Id - An
ItemLocalIduniquely identifies something within a given “item-like”; that is, within ahir::Item,hir::TraitItem, orhir::ImplItem. There is no guarantee that the numerical value of a givenItemLocalIdcorresponds to the node’s position within the owning item in any way, but there is a guarantee that theItemLocalIds within an owner occupy a dense range of integers starting at zero, so a mapping that maps all or most nodes within an “item-like” to something else can be implemented by aVecinstead of a tree or hash map. - OwnerId
Constants§
- CRATE_
HIR_ ID - The
HirIdcorresponding toCRATE_NODE_IDandCRATE_DEF_ID. - CRATE_
OWNER_ ID