Skip to main content

Crate rustc_hir

Crate rustc_hir 

Source
Expand description

HIR datatypes. See the rustc dev guide for more info.

Re-exports§

pub use lang_items::LangItem;
pub use lang_items::LanguageItems;
pub use target::MethodKind;
pub use target::Target;
pub use hir::*;

Modules§

arena 🔒
Declares an arena that can allocate values of any Copy type, and of any !Copy type listed below.
attrs
Data structures for representing parsed attributes in the Rust compiler. Formerly rustc_attr_data_structures.
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.
diagnostic_items
hir 🔒
intravisit
HIR walker for walking the contents of nodes.
lang_items
Defines lang items.
lints
pat_util
stability 🔒
stable_hash_impls 🔒
target
This module lists attribute targets, with conversions from other types.
weak_lang_items
Validity checking for weak lang items

Macros§

find_attr
Finds attributes in sequences of attributes by pattern matching.

Structs§

Arena
ConstStability
Represents the #[rustc_const_unstable] and #[rustc_const_stable] attributes.
DefaultBodyStability
Represents the #[rustc_default_body_unstable] attribute.
HirId
Uniquely identifies a node in the HIR of the current crate. It is composed of the owner, which is the LocalDefId of the directly enclosing hir::Item, hir::TraitItem, or hir::ImplItem (i.e., the closest “item-like”), and the local_id which is unique within the given owner.
ItemLocalId
An ItemLocalId uniquely identifies something within a given “item-like”; that is, within a hir::Item, hir::TraitItem, or hir::ImplItem. There is no guarantee that the numerical value of a given ItemLocalId corresponds to the node’s position within the owning item in any way, but there is a guarantee that the ItemLocalIds 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 a Vec instead of a tree or hash map.
OwnerId
PartialConstStability
Excludes const_stable_indirect. This is necessary because when -Zforce-unstable-if-unmarked is set, we need to encode standalone #[rustc_const_stable_indirect] attributes
Stability
Represents the following attributes:

Enums§

StabilityLevel
The available stability levels.
StableSince
Rust release in which a feature is stabilized.
UnstableReason

Constants§

CRATE_HIR_ID
The HirId corresponding to CRATE_NODE_ID and CRATE_DEF_ID.
CRATE_OWNER_ID
VERSION_PLACEHOLDER
The version placeholder that recently stabilized features contain inside the since field of the #[stable] attribute.

Type Aliases§

HirIdMap
HirIdMapEntry
HirIdSet
ItemLocalMap
ItemLocalMapEntry
ItemLocalSet