Definitions
Types
Type Contains
A type contains a type , iff:
- , or
- is an ADT and contains a field and contains
- and contains
Types Containing Lifetimes
A type contains a lifetime iff contains the type for some type . A lifetime is nested in a type iff contains a type and contains . We extend these concept to places: a place contains a lifetime iff contains ; is nested in iff is nested in . A lifetime projection is nested if is nested in .
PCG Evaluation Phase
The PCG Evaluation Phases are:
PreOperands
PostOperands
PreMain
PostMain
For every MIR location, a seperate PCG is generated for each phase. They represent the following:
PreOperands
- A reorganization of the initial state1 to prepare to apply the effects of evaluating the operands in the statementPostOperands
- The result of applying the operand effects on thePreOperands
statePreMain
- A reorganization of thePostOperands
state to prepare to apply any other effects of the statementPostMain
- The result of applying any other effects of the statement to thePreMain
state.
Program Point
A program point represents a point within the execution of a Rust function in a way that is more fine-grained than a MIR location (each MIR location has multiple program points which to different stages of evaluation of a statement). Concretely, a program point is either:
- The start of a basic block
- A pair of a MIR location and a PCG evaluation phase
Borrows and Blocking
Blocking
A place blocks a place at a location if a usage of at would invalidate a live borrow contained in the origins of at .
Borrow Liveness
A borrow is live at location if a usage of at would invalidate the borrow.
Directly Borrowed
A place is directly borrowed by a borrow if is exactly the borrowed place (not e.g. a pre- or postfix of the place).
-
The initial state is either the
PostMain
of the previous location within the basic block. Or if this is the first statement within the block, it is the entry state of the block (i.e. the result from joining the final states of incoming basic blocks). ↩