]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-10291.rs
Rollup merge of #97288 - compiler-errors:tcxify-rustdoc, r=Dylan-DPC
[rust.git] / src / test / ui / issues / issue-10291.rs
1 // revisions: base nll
2 // ignore-compare-mode-nll
3 //[nll] compile-flags: -Z borrowck=mir
4
5 fn test<'x>(x: &'x isize) {
6     drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
7         x
8         //[base]~^ ERROR E0312
9         //[nll]~^^ ERROR lifetime may not live long enough
10     }));
11 }
12
13 fn main() {}