diff options
Diffstat (limited to 'src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs')
-rw-r--r-- | src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs new file mode 100644 index 000000000..0ec0179e8 --- /dev/null +++ b/src/test/ui/nll/issue-42574-diagnostic-in-nested-closure.rs @@ -0,0 +1,11 @@ +// 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() { } |