rust/tests/ui/nll/issue-42574-diagnostic-in-nested-closure.rs

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

12 lines
313 B
Rust
Raw Normal View History

2019-07-09 09:56:01 +00:00
// This test illustrates a case where full NLL (enabled by the feature
// switch below) produces superior diagnostics to the NLL-migrate
// mode.
fn doit(data: &'static mut ()) {
|| doit(data);
//~^ ERROR lifetime may not live long enough
//~| ERROR `data` does not live long enough
}
fn main() { }