mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
12 lines
232 B
Rust
12 lines
232 B
Rust
fn main() {
|
|
let i = &3;
|
|
|
|
let f = |x: &i32| -> &i32 { x };
|
|
//~^ ERROR lifetime may not live long enough
|
|
let j = f(i);
|
|
|
|
let g = |x: &i32| { x };
|
|
//~^ ERROR lifetime may not live long enough
|
|
let k = g(i);
|
|
}
|