1 2 3 4 5 6 7 8 9 10 11 12
struct Foo { field: i32, } impl Foo { fn foo<'a>(&self, x: &Foo) -> &Foo { if true { x } else { self } //~^ ERROR lifetime may not live long enough } } fn main() {}