]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/normalization-default.rs
Rollup merge of #106946 - dtolnay:hashlinecolumn, r=m-ou-se
[rust.git] / tests / ui / nll / user-annotations / normalization-default.rs
1 // check-fail
2
3 trait Trait { type Assoc; }
4 impl<'a> Trait for &'a () { type Assoc = &'a (); }
5
6 struct MyTuple<T, U = <&'static () as Trait>::Assoc>(T, U);
7 fn test_tuple(x: &(), y: &()) {
8     MyTuple::<_>((), x);
9     //~^ ERROR
10     let _: MyTuple::<_> = MyTuple((), y);
11     //~^ ERROR
12 }
13
14 struct MyStruct<T, U = <&'static () as Trait>::Assoc> { val: (T, U), }
15 fn test_struct(x: &(), y: &()) {
16     MyStruct::<_> { val: ((), x) };
17     //~^ ERROR
18     let _: MyStruct::<_> = MyStruct { val: ((), y) };
19     //~^ ERROR
20 }
21
22 fn main() {}