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

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

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

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

fn main() {}