summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/matching-lifetimes.rs
blob: 1430dc65591437848afc7b5e4e6a3dd95b1dcc11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Tests that the trait matching code takes lifetime parameters into account.
// (Issue #15517.)

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

trait Tr : Sized {
    fn foo(x: Self) {}
}

impl<'a,'b> Tr for Foo<'a,'b> {
    fn foo(x: Foo<'b,'a>) {
        //~^ ERROR method not compatible with trait
        //~^^ ERROR method not compatible with trait
    }
}

fn main(){}