rust/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-retur...

15 lines
206 B
Rust

//@ run-rustfix
#![allow(dead_code)]
struct Foo {
field: i32,
}
impl Foo {
fn foo<'a>(&self, x: &i32) -> &i32 {
x
//~^ ERROR lifetime may not live long enough
}
}
fn main() {}