Expand description
A public API provided for the Rust compiler consumers. This file provides API for compiler consumers.
Structs§
- Body
With Borrowck Facts - A
Bodywith information computed by the borrow checker. This struct is intended to be consumed by compiler consumers. - Borrow
Data - Borrow
Index - Borrow
Set - Borrowck
Consumer 🔒 - Struct used during mir borrowck to collect bodies with facts for a typeck root and all its nested bodies.
- Borrows
Borrowsstores the data used in the analyses that track the flow of borrows.- Outlives
Constraint - Polonius
Location Table - Maps between a MIR Location, which identifies a particular
statement within a basic block, to a “rich location”, which
identifies at a finer granularity. In particular, we distinguish
the start of a statement and the mid-point. The mid-point is
the point just before the statement takes effect; in particular,
for an assignment
A = B, it is the point where B is about to be written into A. This mid-point is a kind of hack to work around our inability to track the position information at sufficient granularity through outlives relations; however, the rich location table serves another purpose: it compresses locations from multiple words into a single u32. - Polonius
Region Vid - A (kinda) newtype of
RegionVidso we can implementAtomon it. - Region
Inference Context - Rustc
Facts
Enums§
- Consumer
Options - Options determining the output behavior of
get_bodies_with_borrowck_facts. - Place
Conflict Bias - When checking if a place conflicts with another place, this enum is used to influence decisions
where a place might be equal or disjoint with another place, such as if
a[i] == a[j].PlaceConflictBias::Overlapwould bias toward assuming thatimight equaljand that these places overlap.PlaceConflictBias::NoOverlapassumes that for the purposes of the predicate being run in the calling context, the conservative choice is to assume the compared indices are disjoint (and therefore, do not overlap). - Rich
Location - TwoPhase
Activation - Location where a two-phase borrow is activated, if a borrow is in fact a two-phase borrow.
Traits§
Functions§
- calculate_
borrows_ out_ of_ scope_ at_ location - get_
bodies_ with_ borrowck_ facts - This function computes borrowck facts for the given def id and all its nested bodies.
It must be called with a typeck root which will then borrowck all nested bodies as well.
The
ConsumerOptionsdetermine which facts are returned. This function makes a copy of the bodies because it needs to regenerate the region identifiers. It should never be invoked during a typical compilation session due to the unnecessary overhead of returningBodyWithBorrowckFacts. - places_
conflict - Helper function for checking if places conflict with a mutable borrow and deep access depth. This is used to check for places conflicting outside of the borrow checking code (such as in dataflow).