summary refs log tree commit diff
path: root/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs
blob: f45370e5c2e5be31af0b4201b1450a4a2fc19cdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// This test illustrates a case where full NLL (enabled by the feature
// switch below) produces superior diagnostics to the NLL-migrate
// mode.

#![feature(nll)]

fn doit(data: &'static mut ()) {
    || doit(data);
    //~^ ERROR lifetime may not live long enough
    //~| ERROR `data` does not live long enough
}

fn main() { }