Move check_region_obligations_and_report_errors to TypeErrCtxt
This commit is contained in:
@@ -468,7 +468,7 @@ fn check_opaque_meets_bounds<'tcx>(
|
||||
// Can have different predicates to their defining use
|
||||
hir::OpaqueTyOrigin::TyAlias => {
|
||||
let outlives_environment = OutlivesEnvironment::new(param_env);
|
||||
let _ = infcx.check_region_obligations_and_report_errors(
|
||||
let _ = infcx.err_ctxt().check_region_obligations_and_report_errors(
|
||||
defining_use_anchor,
|
||||
&outlives_environment,
|
||||
);
|
||||
|
||||
@@ -619,7 +619,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
|
||||
Some(infcx),
|
||||
infcx.implied_bounds_tys(param_env, impl_m_hir_id, wf_tys),
|
||||
);
|
||||
infcx.check_region_obligations_and_report_errors(
|
||||
infcx.err_ctxt().check_region_obligations_and_report_errors(
|
||||
impl_m.def_id.expect_local(),
|
||||
&outlives_environment,
|
||||
)?;
|
||||
@@ -1651,8 +1651,9 @@ pub(super) fn compare_impl_const_raw(
|
||||
}
|
||||
|
||||
let outlives_environment = OutlivesEnvironment::new(param_env);
|
||||
infcx.check_region_obligations_and_report_errors(impl_const_item_def, &outlives_environment)?;
|
||||
|
||||
infcx
|
||||
.err_ctxt()
|
||||
.check_region_obligations_and_report_errors(impl_const_item_def, &outlives_environment)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1760,7 +1761,7 @@ fn compare_type_predicate_entailment<'tcx>(
|
||||
// Finally, resolve all regions. This catches wily misuses of
|
||||
// lifetime parameters.
|
||||
let outlives_environment = OutlivesEnvironment::new(param_env);
|
||||
infcx.check_region_obligations_and_report_errors(
|
||||
infcx.err_ctxt().check_region_obligations_and_report_errors(
|
||||
impl_ty.def_id.expect_local(),
|
||||
&outlives_environment,
|
||||
)?;
|
||||
@@ -1974,7 +1975,7 @@ pub(super) fn check_type_bounds<'tcx>(
|
||||
let outlives_environment =
|
||||
OutlivesEnvironment::with_bounds(param_env, Some(&infcx), implied_bounds);
|
||||
|
||||
infcx.check_region_obligations_and_report_errors(
|
||||
infcx.err_ctxt().check_region_obligations_and_report_errors(
|
||||
impl_ty.def_id.expect_local(),
|
||||
&outlives_environment,
|
||||
)?;
|
||||
|
||||
@@ -115,7 +115,9 @@ pub(super) fn enter_wf_checking_ctxt<'tcx, F>(
|
||||
let outlives_environment =
|
||||
OutlivesEnvironment::with_bounds(param_env, Some(infcx), implied_bounds);
|
||||
|
||||
let _ = infcx.check_region_obligations_and_report_errors(body_def_id, &outlives_environment);
|
||||
let _ = infcx
|
||||
.err_ctxt()
|
||||
.check_region_obligations_and_report_errors(body_def_id, &outlives_environment);
|
||||
}
|
||||
|
||||
fn check_well_formed(tcx: TyCtxt<'_>, def_id: hir::OwnerId) {
|
||||
|
||||
Reference in New Issue
Block a user