Use deeply_normalize_with_skipped_universes in when processing type outlives

This commit is contained in:
Michael Goulet 2024-01-30 21:48:54 +00:00
parent bf3c6c5bed
commit 0e16885abd
2 changed files with 10 additions and 2 deletions

View file

@ -24,12 +24,13 @@ fn resolve_regions(
let ty = self.resolve_vars_if_possible(ty);
if self.next_trait_solver() {
crate::solve::deeply_normalize(
crate::solve::deeply_normalize_with_skipped_universes(
self.at(
&ObligationCause::dummy_with_span(origin.span()),
outlives_env.param_env,
),
ty,
vec![None; ty.outer_exclusive_binder().as_usize()],
)
.map_err(|_| ty)
} else {

View file

@ -1,4 +1,4 @@
// revisions: normalize_param_env normalize_obligation
// revisions: normalize_param_env normalize_obligation hrtb
// check-pass
// compile-flags: -Znext-solver
@ -7,16 +7,23 @@ trait Foo {
type Gat<'a> where <Self as Mirror>::Assoc: 'a;
#[cfg(normalize_obligation)]
type Gat<'a> where Self: 'a;
#[cfg(hrtb)]
type Gat<'b> where for<'a> <Self as MirrorRegion<'a>>::Assoc: 'b;
}
trait Mirror { type Assoc: ?Sized; }
impl<T: ?Sized> Mirror for T { type Assoc = T; }
trait MirrorRegion<'a> { type Assoc: ?Sized; }
impl<'a, T> MirrorRegion<'a> for T { type Assoc = T; }
impl<T> Foo for T {
#[cfg(normalize_param_env)]
type Gat<'a> = i32 where T: 'a;
#[cfg(normalize_obligation)]
type Gat<'a> = i32 where <T as Mirror>::Assoc: 'a;
#[cfg(hrtb)]
type Gat<'b> = i32 where Self: 'b;
}
fn main() {}