rust/tests/ui/nll/issue-58053.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
232 B
Rust
Raw Normal View History

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);
}