rust/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs
2023-01-11 09:32:08 +00:00

13 lines
195 B
Rust

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() {}