Normalize the whole PolyTypeOutlivesPredicate, more simplifications

This commit is contained in:
Michael Goulet 2024-02-02 18:31:35 +00:00
parent a371059933
commit e951bcff96
10 changed files with 92 additions and 81 deletions

View file

@ -1,5 +1,6 @@
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
use rustc_infer::infer::{InferCtxt, RegionResolutionError};
use rustc_middle::traits::query::NoSolution;
use rustc_middle::traits::ObligationCause;
pub trait InferCtxtRegionExt<'tcx> {
@ -24,15 +25,14 @@ impl<'tcx> InferCtxtRegionExt<'tcx> for InferCtxt<'tcx> {
let ty = self.resolve_vars_if_possible(ty);
if self.next_trait_solver() {
crate::solve::deeply_normalize_with_skipped_universes(
crate::solve::deeply_normalize(
self.at(
&ObligationCause::dummy_with_span(origin.span()),
outlives_env.param_env,
),
ty,
vec![None; ty.outer_exclusive_binder().as_usize()],
)
.map_err(|_| ty)
.map_err(|_| NoSolution)
} else {
Ok(ty)
}

View file

@ -179,7 +179,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
}
let outlives_env = OutlivesEnvironment::new(full_env);
let _ = infcx.process_registered_region_obligations::<!>(&outlives_env, |ty, _| Ok(ty));
let _ = infcx.process_registered_region_obligations(&outlives_env, |ty, _| Ok(ty));
let region_data =
infcx.inner.borrow_mut().unwrap_region_constraints().region_constraint_data().clone();