pub(crate) fn type_check<'a, '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>,
flow_inits: ResultsCursor<'a, 'tcx, MaybeInitializedPlaces<'a, 'tcx>>,
move_data: &MoveData<'tcx>,
location_map: Rc<DenseLocationMap>,
concrete_opaque_types: &mut ConcreteOpaqueTypes<'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 usebody
– MIR body to type-checkpromoted
– map of promoted constants withinbody
universal_regions
– the universal regions frombody
s function signaturelocation_table
– for datalog polonius, the map betweenLocation
s andRichLocation
sborrow_set
– information about borrows occurring inbody
polonius_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 analysislocation_map
– map between MIRLocation
andPointIndex