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.
The mode of a binding (mut, ref mut, etc).
Used for both the explicit binding annotations given in the HIR for a binding
and the final binding mode that we infer after type inference/match ergonomics.
.0 is the by-reference mode (ref, ref mut, or by value),
.1 is the mutability of the binding.
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.
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.
A reference from a foreign block to one of its 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).
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).
Represents a let <pat>[: <ty>] = <expr> expression (not a LetStmt), occurring in an if-let
or let-else, evaluating to a boolean. Typically the pattern is refutable.
Map of all HIR nodes inside the current owner.
These nodes are mapped by ItemLocalId alongside the index of their parent node.
The HIR tree, including bodies, is pre-hashed.
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.
We need to have a Node for the HirId that we attach the type/const param
resolution to. Lifetimes don’t have this problem, and for them, it’s actually
kind of detrimental to use a custom node type versus just using Lifetime,
since resolve_bound_vars operates on Lifetimes.
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).
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).
The actualy safety specified in syntax. We may treat
its safety different within the type system to create a
“sound by default” system that needs checking this enum
explicitly to allow unsafe operations.
Checks if the specified expression needs parentheses for prefix
or postfix suggestions to be valid.
For example, a + b requires parentheses to suggest &(a + b),
but just a does not.
Similarly, (a + b).c() also requires parentheses.
This should not be used for other types of suggestions.