]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-40510-1.rs
Rollup merge of #60492 - acrrd:issues/54054_chain, r=SimonSapin
[rust.git] / src / test / ui / issues / issue-40510-1.rs
1 #![feature(rustc_attrs)]
2 #![allow(unused)]
3
4 // revisions: migrate nll
5 #![cfg_attr(nll, feature(nll))]
6
7 fn f() {
8     let mut x: Box<()> = Box::new(());
9
10     || {
11         &mut x
12     };
13     //[migrate]~^^ WARNING captured variable cannot escape `FnMut` closure body
14     //[migrate]~| WARNING this error has been downgraded to a warning
15     //[migrate]~| WARNING this warning will become a hard error in the future
16     //[nll]~^^^^^ ERROR captured variable cannot escape `FnMut` closure body
17 }
18
19 #[rustc_error]
20 fn main() {}
21 //[migrate]~^ ERROR