mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
13 lines
195 B
Rust
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() {}
|