rust/tests/ui/regions/regions-nested-fns-2.rs
2023-01-11 09:32:08 +00:00

13 lines
247 B
Rust

fn ignore<F>(_f: F) where F: for<'z> FnOnce(&'z isize) -> &'z isize {}
fn nested() {
let y = 3;
ignore(
|z| {
if false { &y } else { z }
//~^ ERROR `y` does not live long enough
});
}
fn main() {}