]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-40510-1.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-40510-1.rs
index dd8a6bc5ab2bd73f0a2bdce2e0844dca22e09ab4..6ecbeefd88115801d2b6a5f9a5204ac886f5df7f 100644 (file)
@@ -1,13 +1,21 @@
-// compile-pass
+#![feature(rustc_attrs)]
 #![allow(unused)]
 
+// revisions: migrate nll
+#![cfg_attr(nll, feature(nll))]
+
 fn f() {
     let mut x: Box<()> = Box::new(());
 
     || {
         &mut x
     };
+    //[migrate]~^^ WARNING captured variable cannot escape `FnMut` closure body
+    //[migrate]~| WARNING this error has been downgraded to a warning
+    //[migrate]~| WARNING this warning will become a hard error in the future
+    //[nll]~^^^^^ ERROR captured variable cannot escape `FnMut` closure body
 }
 
-
+#[rustc_error]
 fn main() {}
+//[migrate]~^ ERROR