mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
20 lines
284 B
Rust
20 lines
284 B
Rust
fn foo(_: impl FnOnce(&u32) -> &u32) {
|
|
}
|
|
|
|
fn baz(_: impl FnOnce(&u32, u32) -> &u32) {
|
|
}
|
|
|
|
fn bar() {
|
|
let x = 22;
|
|
foo(|a| &x)
|
|
//~^ ERROR does not live long enough
|
|
}
|
|
|
|
fn foobar() {
|
|
let y = 22;
|
|
baz(|first, second| &y)
|
|
//~^ ERROR does not live long enough
|
|
}
|
|
|
|
fn main() { }
|