pub(crate) fn type_check<'tcx>(
root_cx: &mut BorrowCheckRootCtxt<'tcx>,
infcx: &BorrowckInferCtxt<'tcx>,
body: &Body<'tcx>,
promoted: &IndexSlice<Promoted, Body<'tcx>>,
universal_regions: UniversalRegions<'tcx>,
location_table: &PoloniusLocationTable,
borrow_set: &BorrowSet<'tcx>,
polonius_facts: &mut Option<PoloniusFacts>,
move_data: &MoveData<'tcx>,
location_map: Rc<DenseLocationMap>,
) -> 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 usebody– MIR body to type-checkpromoted– map of promoted constants withinbodyuniversal_regions– the universal regions frombodys function signaturelocation_table– for datalog polonius, the map betweenLocations andRichLocationsborrow_set– information about borrows occurring inbodypolonius_facts– when using Polonius, this is the generated set of Polonius factsmove_data– move-data constructed when performing the maybe-init dataflow analysislocation_map– map between MIRLocationandPointIndex