pub(crate) fn type_check<'a, 'tcx>(
infcx: &BorrowckInferCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
body: &Body<'tcx>,
promoted: &IndexSlice<Promoted, Body<'tcx>>,
universal_regions: Rc<UniversalRegions<'tcx>>,
location_table: &LocationTable,
borrow_set: &BorrowSet<'tcx>,
all_facts: &mut Option<AllFacts>,
flow_inits: &mut ResultsCursor<'a, 'tcx, MaybeInitializedPlaces<'a, 'tcx>>,
move_data: &MoveData<'tcx>,
elements: Rc<DenseLocationMap>,
upvars: &[&CapturedPlace<'tcx>],
) -> MirTypeckResults<'tcx>
Expand description
Type checks the given mir
in the context of the inference
context infcx
. 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.
This phase of type-check ought to be infallible – this is because
the original, HIR-based type-check succeeded. So if any errors
occur here, we will get a bug!
reported.
§Parameters
infcx
– inference context to useparam_env
– parameter environment to use for trait solvingbody
– MIR body to type-checkpromoted
– map of promoted constants withinbody
universal_regions
– the universal regions frombody
s function signaturelocation_table
– MIR location map ofbody
borrow_set
– information about borrows occurring inbody
all_facts
– when using Polonius, this is the generated set of Polonius factsflow_inits
– results of a maybe-init dataflow analysismove_data
– move-data constructed when performing the maybe-init dataflow analysiselements
– MIR region map