summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-nested-fns-2.rs
blob: 3b3e26c4503d41c9ff51dcb3377c052c65f23952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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() {}