rust/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-nam...

15 lines
209 B
Rust

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