Expand description
This pass type-checks the MIR to ensure it is not broken.
Modulesยง
- canonical ๐
- constraint_
conversion ๐ - free_
region_ ๐relations - input_
output ๐ - This module contains code to equate the input/output types appearing
in the MIR with the expected input/output types from the function
signature. This requires a bit of processing, as the expected types
are supplied to us before normalization and may contain opaque
impl Trait
instances. In contrast, the input/output types found in the MIR (specifically, in the special local variables for theRETURN_PLACE
the MIR arguments) are always fully normalized (and contain revealedimpl Trait
values). - liveness ๐
- opaque_
types ๐ - relate_
tys ๐
Macrosยง
- span_
mirbug ๐
Structsยง
- Instantiate
Opaque ๐Type - Runs
infcx.instantiate_opaque_types
. Unlike otherTypeOp
s, this is not canonicalized - it directly affects the mainInferCtxt
that we use during MIR borrowchecking. - MirTypeck
Region ๐Constraints - A collection of region constraints that must be satisfied for the program to be considered well-typed.
- MirTypeck
Results ๐ - Holder struct for passing results from MIR typeck to the rest of the non-lexical regions inference computation.
- Type
Checker ๐ - The MIR type checker. Visits the MIR and enforces all the constraints needed for it to be valid and well-typed. Along the way, it accrues region constraints โ these can later be used by NLL region checking.
- Type
Verifier ๐ - Verifies that MIR types are sane.
Enumsยง
- Field
Access ๐Error - Locations
- The
Locations
type summarizes where region constraints are required to hold. Normally, this is at a particular point which created the obligation, but for constraints that the user gave, we want the constraint to hold at all points.
Traitsยง
- Normalize
Location ๐
Functionsยง
- freshen_
single_ ๐trait_ object_ lifetime - mirbug ๐
- type_
check ๐ - Type checks the given
mir
in the context of the inference contextinfcx
. Returns any region constraints that have yet to be proven. This result includes liveness constraints that ensure that regions appearing in the types of all local variables are live at all points where that local variable may later be used.