]> git.proxmox.com Git - rustc.git/blobdiff - src/test/compile-fail/unboxed-closures-mutated-upvar-from-fn-closure.rs
New upstream version 1.24.1+dfsg1
[rustc.git] / src / test / compile-fail / unboxed-closures-mutated-upvar-from-fn-closure.rs
index 432c7fa5d1b2025c9d8d2605e7bb31052ac80fd2..0dbd61413e053d9ebd23976eddff7f2665c55857 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// revisions: ast mir
+//[mir]compile-flags: -Z borrowck=mir
+
 // Test that a by-ref `FnMut` closure gets an error when it tries to
 // mutate a value.
 
@@ -19,6 +22,7 @@ fn main() {
     let mut counter = 0;
     call(|| {
         counter += 1;
-        //~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure
+        //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure
+        //[mir]~^^ ERROR cannot assign to immutable item `counter`
     });
 }