Function rustc_mir::borrow_check::nll::type_check::type_check [−][src]
fn type_check<'gcx, 'tcx>(
infcx: &InferCtxt<'_, 'gcx, 'tcx>,
param_env: ParamEnv<'gcx>,
mir: &Mir<'tcx>,
mir_def_id: DefId,
universal_regions: &UniversalRegions<'tcx>,
liveness: &LivenessResults,
flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
move_data: &MoveData<'tcx>
) -> MirTypeckRegionConstraints<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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
infcx
-- inference context to useparam_env
-- parameter environment to use for trait solvingmir
-- MIR to type-checkmir_def_id
-- DefId from which the MIR is derived (must be local)region_bound_pairs
-- the implied outlives obligations between type parameters and lifetimes (e.g.,&'a T
impliesT: 'a
)implicit_region_bound
-- a region which all generic parameters are assumed to outlive; should represent the fn bodyinput_tys
-- fully liberated, but not normalized, expected types of the arguments; the types of the input parameters found in the MIR itself will be equated with theseoutput_ty
-- fully liberaetd, but not normalized, expected return type; the type for the RETURN_PLACE will be equated with thisliveness
-- results of a liveness computation on the MIR; used to create liveness constraints for the regions in the types of variablesflow_inits
-- results of a maybe-init dataflow analysismove_data
-- move-data constructed when performing the maybe-init dataflow analysis