Skip to content

Commit 0e16885

Browse files
Use deeply_normalize_with_skipped_universes in when processing type outlives
1 parent bf3c6c5 commit 0e16885

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

compiler/rustc_trait_selection/src/regions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ impl<'tcx> InferCtxtRegionExt<'tcx> for InferCtxt<'tcx> {
2424
let ty = self.resolve_vars_if_possible(ty);
2525

2626
if self.next_trait_solver() {
27-
crate::solve::deeply_normalize(
27+
crate::solve::deeply_normalize_with_skipped_universes(
2828
self.at(
2929
&ObligationCause::dummy_with_span(origin.span()),
3030
outlives_env.param_env,
3131
),
3232
ty,
33+
vec![None; ty.outer_exclusive_binder().as_usize()],
3334
)
3435
.map_err(|_| ty)
3536
} else {
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// revisions: normalize_param_env normalize_obligation
1+
// revisions: normalize_param_env normalize_obligation hrtb
22
// check-pass
33
// compile-flags: -Znext-solver
44

@@ -7,16 +7,23 @@ trait Foo {
77
type Gat<'a> where <Self as Mirror>::Assoc: 'a;
88
#[cfg(normalize_obligation)]
99
type Gat<'a> where Self: 'a;
10+
#[cfg(hrtb)]
11+
type Gat<'b> where for<'a> <Self as MirrorRegion<'a>>::Assoc: 'b;
1012
}
1113

1214
trait Mirror { type Assoc: ?Sized; }
1315
impl<T: ?Sized> Mirror for T { type Assoc = T; }
1416

17+
trait MirrorRegion<'a> { type Assoc: ?Sized; }
18+
impl<'a, T> MirrorRegion<'a> for T { type Assoc = T; }
19+
1520
impl<T> Foo for T {
1621
#[cfg(normalize_param_env)]
1722
type Gat<'a> = i32 where T: 'a;
1823
#[cfg(normalize_obligation)]
1924
type Gat<'a> = i32 where <T as Mirror>::Assoc: 'a;
25+
#[cfg(hrtb)]
26+
type Gat<'b> = i32 where Self: 'b;
2027
}
2128

2229
fn main() {}

0 commit comments

Comments
 (0)