summary refs log tree commit diff
path: root/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.rs
blob: a77d6af5323c2c5b6d0cdaea77e7e50a694ef9a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(nll)]

// Check that substitutions given on the self type (here, `A`) can be
// used in combination with annotations given for method arguments.

struct A<'a> { x: &'a u32 }

impl<'a> A<'a> {
    fn new<'b, T>(x: &'a u32, y: T) -> Self {
        Self { x }
    }
}

fn foo<'a>() {
    let v = 22;
    let x = A::<'a>::new::<&'a u32>(&v, &v);
    //~^ ERROR
    //~| ERROR
}

fn main() {}