]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-40510-3.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-40510-3.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: Vec<()> = Vec::new();
9
10     || {
11         || {
12             x.push(())
13         }
14         //[migrate]~^^^ WARNING captured variable cannot escape `FnMut` closure body
15         //[migrate]~| WARNING this error has been downgraded to a warning
16         //[migrate]~| WARNING this warning will become a hard error in the future
17         //[nll]~^^^^^^ ERROR captured variable cannot escape `FnMut` closure body
18     };
19 }
20
21 #[rustc_error]
22 fn main() {}
23 //[migrate]~^ ERROR