Crate rustc_borrowck[−][src]
Expand description
This query borrow-checks the MIR to (further) ensure it is not broken.
Modules
This file provides API for compiler consumers.
Borrow checker diagnostics.
The entry point of the NLL borrow checker.
From the NLL RFC: “The deep [aka ‘supporting’] prefixes for an place are formed by stripping away fields and derefs, except that we stop when we reach the deref of a shared reference. […] “
Defines how the compiler represents types internally.
This pass type-checks the MIR to ensure it is not broken.
Code to extract the universally quantified regions declared on a function and the relationships between them. For example:
Composable external iteration.
Basic functions for dealing with memory.
Structs
A node in the MIR control-flow graph.
A fixed-size bitset type with a dense representation.
The lowered representation of a single function.
A Body with information computed by the borrow checker. This struct is
intended to be consumed by compiler consumers.
A composite describing a Place that is captured by a closure.
Used for emitting structured error messages and other diagnostic information.
EverInitializedPlaces tracks all places that might have ever been
initialized upon reaching a particular point in the control flow
for a function, without an intervening StorageDead.
A LocalDefId is equivalent to a DefId with krate == LOCAL_CRATE. Since
we encode this information in the type, we can ensure at compile time that
no DefIds from upstream crates get thrown into the mix. There are quite a
few cases where we know that only DefIds from the local crate are expected
and a DefId from a different crate would signify a bug somewhere. This
is when LocalDefId comes in handy.
Location represents the position of the start of the statement; or, if
statement_index equals the number of statements, then the start of the
terminator.
MaybeInitializedPlaces tracks all places that might be
initialized upon reaching a particular point in the control flow
for a function.
MaybeUninitializedPlaces tracks all places that might be
uninitialized upon reaching a particular point in the control flow
for a function.
When type checking, we use the ParamEnv to track
details about the set of where-clauses that are in scope at this
particular point.
A path to a value; something that can be evaluated without changing or disturbing program state.
A region (lifetime) variable ID.
A Vec-like container that can store a small number of elements inline.
A compressed span.
An interned string.
The central data structure of the compiler. It stores references to the various arenas and also houses the results of the various compiler queries that have been performed. See the rustc dev guide for more details.
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
A mutable memory location with dynamically checked borrow rules
Enums
Indicates the confidence in the correctness of a suggestion.
The enum Either with variants Left and Right is a general purpose
sum type with two cases.
Initializations can be from an argument or from a statement. Arguments
do not have locations, in those cases the Local is kept..
When checking permissions for a place access, this flag is used to indicate that an immutable local place can be mutated.
These are values that can appear inside an rvalue. They are intentionally limited to prevent rvalues from being nested in one another.
The degree of overlap between 2 places for borrow-checking.
Kind of read access to a value (For informational purposes only)
Kind of access to a value: read or write (For informational purposes only)
Rvalues
Kind of write access to a value (For informational purposes only)
Constants
Dummy span, both position and length are zero, syntax context is zero as well.
Statics
The mutable_borrow_reservation_conflict lint detects the reservation
of a two-phased borrow that conflicts with other shared borrows.
The unused_mut lint detects mut variables which don’t need to be
mutable.
Traits
A dataflow problem with an arbitrarily complex transfer function.