Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Definitions

Types

Type Contains

A type contains a type , iff:

  1. , or
  2. is an ADT and contains a field and contains
  3. 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 statement
  • PostOperands - The result of applying the operand effects on the PreOperands state
  • PreMain - A reorganization of the PostOperands state to prepare to apply any other effects of the statement
  • PostMain - The result of applying any other effects of the statement to the PreMain 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).


  1. 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).