rust/tests/ui/regions/regions-nested-fns-2.rs

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

13 lines
247 B
Rust
Raw Normal View History

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