Skip to content

Commit ce0c952

Browse files
Deeply normalize args for implied bounds
1 parent a02a982 commit ce0c952

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Diff for: compiler/rustc_borrowck/src/type_check/free_region_relations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
264264
}
265265
let TypeOpOutput { output: norm_ty, constraints: constraints_normalize, .. } =
266266
param_env
267-
.and(type_op::normalize::Normalize { value: ty })
267+
.and(DeeplyNormalize { value: ty })
268268
.fully_perform(self.infcx, span)
269269
.unwrap_or_else(|guar| TypeOpOutput {
270270
output: Ty::new_error(self.infcx.tcx, guar),
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ check-pass
2+
//@ revisions: current next
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
4+
//@[next] compile-flags: -Znext-solver
5+
6+
// Make sure that we can normalize `<T as Ref<'a>>::Assoc` to `&'a T` and get
7+
// its implied bounds.
8+
9+
trait Ref<'a> {
10+
type Assoc;
11+
}
12+
impl<'a, T> Ref<'a> for T where T: 'a {
13+
type Assoc = &'a T;
14+
}
15+
16+
fn outlives<'a, T: 'a>() {}
17+
18+
fn test<'a, T>(_: <T as Ref<'a>>::Assoc) {
19+
outlives::<'a, T>();
20+
}
21+
22+
fn main() {}

0 commit comments

Comments
 (0)