]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/normalization-self.rs
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / ui / nll / user-annotations / normalization-self.rs
1 // check-fail
2
3 trait Trait { type Assoc; }
4 impl<'a> Trait for &'a () { type Assoc = &'a (); }
5
6 struct MyTuple<T>(T);
7 impl MyTuple<<&'static () as Trait>::Assoc> {
8     fn test(x: &(), y: &()) {
9         Self(x);
10         //~^ ERROR
11         let _: Self = MyTuple(y);
12         //~^ ERROR
13     }
14 }
15
16 struct MyStruct<T> { val: T, }
17 impl MyStruct<<&'static () as Trait>::Assoc> {
18     fn test(x: &(), y: &()) {
19         Self { val: x };
20         //~^ ERROR
21         let _: Self = MyStruct { val: y };
22         //~^ ERROR
23     }
24 }
25
26 fn main() {}