summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/user-annotations/normalization-default.rs
blob: fa52e6d857f6f62e3b3d6f57265f701fb053ba9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// check-fail

trait Trait { type Assoc; }
impl<'a> Trait for &'a () { type Assoc = &'a (); }

struct MyTuple<T, U = <&'static () as Trait>::Assoc>(T, U);
fn test_tuple(x: &(), y: &()) {
    MyTuple::<_>((), x);
    //~^ ERROR
    let _: MyTuple::<_> = MyTuple((), y);
    //~^ ERROR
}

struct MyStruct<T, U = <&'static () as Trait>::Assoc> { val: (T, U), }
fn test_struct(x: &(), y: &()) {
    MyStruct::<_> { val: ((), x) };
    //~^ ERROR
    let _: MyStruct::<_> = MyStruct { val: ((), y) };
    //~^ ERROR
}

fn main() {}