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

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

20 lines
284 B
Rust
Raw Normal View History

fn foo(_: impl FnOnce(&u32) -> &u32) {
}
fn baz(_: impl FnOnce(&u32, u32) -> &u32) {
}
fn bar() {
let x = 22;
foo(|a| &x)
2018-11-27 09:56:36 +00:00
//~^ ERROR does not live long enough
}
fn foobar() {
let y = 22;
baz(|first, second| &y)
2018-11-27 09:56:36 +00:00
//~^ ERROR does not live long enough
}
fn main() { }