]> git.proxmox.com Git - rustc.git/blob - tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / tests / ui / implied-bounds / implied-bounds-unconstrained-2.rs
1 // check-pass
2
3 // Another minimized regression test for #112832.
4 trait Trait {
5 type Assoc;
6 }
7
8 trait Sub<'a>: Trait<Assoc = <Self as Sub<'a>>::SubAssoc> {
9 type SubAssoc;
10 }
11
12 // By using the where-clause we normalize `<T as Trait>::Assoc` to
13 // `<T as Sub<'a>>::SubAssoc` where `'a` is an unconstrained region
14 // variable.
15 fn foo<T>(x: <T as Trait>::Assoc)
16 where
17 for<'a> T: Sub<'a>,
18 {}
19
20 fn main() {}