summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lifetimes/lifetime-mismatch-between-trait-and-impl.rs
blob: 2ce1a0f45465170d808a29005ed8d4f251c4069f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
trait Foo {
    fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32;
}

impl Foo for () {
    fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
    //~^ ERROR `impl` item signature doesn't match `trait` item signature
        if x > y { x } else { y }
    }
}

fn main() {}