Expand description
A public API provided for the Rust compiler consumers. This file provides API for compiler consumers.
Structs§
- Body
With Borrowck Facts - A
Body
with information computed by the borrow checker. This struct is intended to be consumed by compiler consumers. - Borrow
Data - Borrow
Index - Borrow
Set - Borrows
Borrows
stores 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
RegionVid
so we can implementAtom
on it. - Region
Inference Context - Rustc
Facts
Enums§
- Consumer
Options - Options determining the output behavior of
get_body_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::Overlap
would bias toward assuming thati
might equalj
and that these places overlap.PlaceConflictBias::NoOverlap
assumes 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_
body_ with_ borrowck_ facts - This function computes borrowck facts for the given body. The
ConsumerOptions
determine which facts are returned. This function makes a copy of the body 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).