[][src]Function rustc_mir::borrow_check::type_check::type_check

pub(crate) fn type_check<'mir, 'tcx>(
    infcx: &InferCtxt<'_, 'tcx>,
    param_env: ParamEnv<'tcx>,
    body: &Body<'tcx>,
    promoted: &IndexVec<Promoted, Body<'tcx>>,
    mir_def_id: LocalDefId,
    universal_regions: &Rc<UniversalRegions<'tcx>>,
    location_table: &LocationTable,
    borrow_set: &BorrowSet<'tcx>,
    all_facts: &mut Option<PoloniusFacts<RustcFacts>>,
    flow_inits: &mut ResultsCursor<'mir, 'tcx, MaybeInitializedPlaces<'mir, 'tcx>>,
    move_data: &MoveData<'tcx>,
    elements: &Rc<RegionValueElements>,
    upvars: &[Upvar]
) -> MirTypeckResults<'tcx>

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 is 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