[][src]Module rustc::hir

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

HIR datatypes. See the rustc guide for more info.

Re-exports

pub use self::BlockCheckMode::*;
pub use self::CaptureClause::*;
pub use self::FunctionRetTy::*;
pub use self::Mutability::*;
pub use self::PrimTy::*;
pub use self::UnOp::*;
pub use self::UnsafeSource::*;

Modules

check_attrInternal

This module implements some validity checks for attributes. In particular it verifies that #[inline] and #[repr] attributes are attached to items that actually support them and if there are conflicts between multiple such attributes attached to the same item.

defInternal
def_idInternal
intravisitInternal

HIR walker for walking the contents of nodes.

item_local_id_innerInternal
itemlikevisitInternal
loweringInternal

Lowers the AST to the HIR.

mapInternal
pat_utilInternal
printInternal
ptrInternal
upvarsInternal

Upvar (closure capture) collection from cross-body HIR uses of Res::Locals.

Structs

AnonConstInternal

A constant (expression) that's not an item or associated item, but needs its own DefId for type-checking, const-eval, etc. These are usually found nested inside types (e.g., array lengths) or expressions (e.g., repeat counts), and also used to define explicit discriminant values for enum variants.

ArgInternal

Represents an argument in a function header.

ArmInternal

Represents a single arm of a match expression, e.g. <pats> (if <guard>) => <body>.

BareFnTyInternal
BlockInternal

A block of statements { .. }, which may have a label (in this case the targeted_by_break field will be true) and may be unsafe by means of the rules being anything but DefaultBlock.

BodyInternal

The body of a function, closure, or constant value. In the case of a function, the body contains not only the function body itself (which is an expression), but also the argument patterns, since those are something that the caller doesn't really care about.

BodyIdInternal
CodegenFnAttrFlagsInternal
CodegenFnAttrsInternal
ConstArgInternal
CrateInternal

The top-level data structure that stores the entire contents of the crate currently being compiled.

DestinationInternal
EnumDefInternal
ExprInternal

An expression

FieldInternal
FieldPatInternal

A single field in a struct pattern.

FnDeclInternal

Represents the header (not the body) of a function declaration.

FnHeaderInternal
ForeignItemInternal
ForeignModInternal
GenericArgsInternal
GenericParamInternal
GenericParamCountInternal
GenericsInternal

Represents lifetimes and type parameters attached to a declaration of a function, enum, trait, etc.

GlobalAsmInternal
HirIdInternal

Uniquely identifies a node in the HIR of the current crate. It is composed of the owner, which is the DefIndex 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.

ImplItemInternal

Represents anything within an impl block.

ImplItemIdInternal
ImplItemRefInternal

A reference from an impl to one of its associated items. This contains the item's ID, naturally, but also the item's name and some other high-level details (like whether it is an associated type or method, and whether it is public). This allows other passes to find the impl they want without loading the ID (which means fewer edges in the incremental compilation graph).

InlineAsmInternal
InlineAsmOutputInternal
ItemInternal

An item

ItemIdInternal
ItemLocalIdInternal

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 LocalItemIds 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.

LifetimeInternal
LocalInternal

Represents a let statement (i.e., let <pat>:<ty> = <expr>;).

MacroDefInternal

A macro definition, in this crate or imported from another.

MethodSigInternal

Represents a method's signature in a trait declaration or implementation.

ModInternal
ModuleItemsInternal
MutTyInternal
OpaqueTyInternal
PatInternal
PathInternal

A Path is essentially Rust's notion of a name; for instance, std::cmp::PartialEq. It's represented as a sequence of identifiers, along with a bunch of supporting information.

PathSegmentInternal

A segment of a path: an identifier, an optional lifetime, and a set of types.

PolyTraitRefInternal
StmtInternal

A statement.

StructFieldInternal
TraitCandidateInternal
TraitItemInternal

Represents an item declaration within a trait declaration, possibly including a default implementation. A trait item is either required (meaning it doesn't have an implementation, just a signature) or provided (meaning it has a default implementation).

TraitItemIdInternal
TraitItemRefInternal

A reference from an trait to one of its associated items. This contains the item's id, naturally, but also the item's name and some other high-level details (like whether it is an associated type or method, and whether it is public). This allows other passes to find the impl they want without loading the ID (which means fewer edges in the incremental compilation graph).

TraitRefInternal

References to traits in impls.

TyInternal
TypeBindingInternal

Bind a type to an associated type (i.e., A = Foo).

UpvarInternal

A variable captured by a closure.

VariantInternal
WhereBoundPredicateInternal

A type bound (e.g., for<'c> Foo: Send + Clone + 'c).

WhereClauseInternal

A where-clause in a definition.

WhereEqPredicateInternal

An equality predicate (e.g., T = int); currently unsupported.

WhereRegionPredicateInternal

A lifetime predicate (e.g., 'a: 'b + 'c).

Enums

AssocItemKindInternal
BinOpKindInternal
BindingAnnotationInternal

Explicit binding annotations given in the HIR for a binding. Note that this is not the final binding mode that we infer after type inference.

BlockCheckModeInternal
BodyOwnerKindInternal
CaptureClauseInternal
ConstnessInternal
DefaultnessInternal
ExprKindInternal
ForeignItemKindInternal

An item within an extern block.

FunctionRetTyInternal
GeneratorKindInternal

The type of source expression that caused this generator to be created.

GeneratorMovabilityInternal

Whether a generator contains self-references, causing it to be !Unpin.

GenericArgInternal
GenericBoundInternal

The AST represents all type param bounds as types. typeck::collect::compute_bounds matches these against the "special" built-in traits (see middle::lang_items) and detects Copy, Send and Sync.

GenericParamKindInternal
GuardInternal
ImplItemKindInternal

Represents various kinds of content within an impl.

ImplPolarityInternal
ImplicitSelfKindInternal

Represents what type of implicit self a function has, if any.

IsAsyncInternal
IsAutoInternal

Is the trait definition an auto trait?

ItemKindInternal
LifetimeNameInternal
LifetimeParamKindInternal
LocalSourceInternal

Hints at the original code for a let statement.

LoopIdErrorInternal
LoopSourceInternal

The loop type that yielded an ExprKind::Loop.

MatchSourceInternal

Hints at the original code for a match _ { .. }.

MutabilityInternal
NodeInternal
OpaqueTyOriginInternal

From whence the opaque type came.

ParamNameInternal
PatKindInternal
PrimTyInternal

Not represented directly in the AST; referred to by name through a ty_path.

QPathInternal

Represents an optionally Self-qualified value/type path or associated extension.

RangeEndInternal
StmtKindInternal

The contents of a statement.

SyntheticTyParamKindInternal

Synthetic type parameters are converted to another form during lowering; this allows us to track the original form they had, and is useful for error messages.

TraitBoundModifierInternal

A modifier on a bound, currently this is only used for ?Sized, where the modifier is Maybe. Negative bounds should also be handled here.

TraitItemKindInternal

Represents a trait method or associated constant or type

TraitMethodInternal

Represents a trait method's body (or just argument names).

TyKindInternal

The various kinds of types recognized by the compiler.

TypeBindingKindInternal
UnOpInternal
UnsafeSourceInternal
UnsafetyInternal
UseKindInternal
VariantDataInternal

Fields and constructor IDs of enum variants and structs.

VisibilityKindInternal
WherePredicateInternal

A single predicate in a where-clause.

YieldSourceInternal

The yield kind that caused an ExprKind::Yield.

Constants

CRATE_HIR_IDInternal

The HirId corresponding to CRATE_NODE_ID and CRATE_DEF_INDEX.

DUMMY_HIR_IDInternal
DUMMY_ITEM_LOCAL_IDInternal
_Internal

Functions

provideInternal

Type Definitions

BinOpInternal
CaptureModeMapInternal
GenericBoundsInternal
GlobMapInternal
HirVecInternal

HIR doesn't commit to a concrete storage type and has its own alias for a vector. It can be Vec, P<[T]> or potentially Box<[T]>, or some other container with similar behavior. Unlike AST, HIR is mostly a static structure, so we can use an owned slice instead of Vec to avoid keeping extra capacity.

LitInternal

A literal.

TraitMapInternal
VisibilityInternal