about summary refs log tree commit diff
path: root/tests/ui/explicit/explicit-self-lifetime-mismatch.rs
blob: aa5e352b6ebef0ff3887625de2c259680cc5217c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ dont-require-annotations: NOTE

struct Foo<'a,'b> {
    x: &'a isize,
    y: &'b isize,
}

impl<'a,'b> Foo<'a,'b> {
    fn bar(self:
           Foo<'b,'a>
    //~^ ERROR mismatched `self` parameter type
    //~| NOTE expected struct `Foo<'a, 'b>`
    //~| NOTE found struct `Foo<'b, 'a>`
    //~| NOTE lifetime mismatch
    //~| ERROR mismatched `self` parameter type
    //~| NOTE expected struct `Foo<'a, 'b>`
    //~| NOTE found struct `Foo<'b, 'a>`
    //~| NOTE lifetime mismatch
           ) {}
}

fn main() {}