]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-10291.rs
Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gcc
[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() {}