]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/augmented-assignments.rs
Auto merge of #102684 - JhonnyBillM:delete-target-data-layout-errors-wrapper, r=davidtwco
[rust.git] / src / test / ui / augmented-assignments.rs
index eea15eae879e66bb678de14a12b6171d7c967937..1b4ac6edcb0d5547ce40b2099cb97c3bb501c55e 100644 (file)
@@ -10,16 +10,18 @@ fn add_assign(&mut self, _: Int) {
 
 fn main() {
     let mut x = Int(1);
-    x   //~ error: use of moved value: `x`
-    //~^ value used here after move
+    x
+    //~^ NOTE borrow of `x` occurs here
     +=
-    x;  //~ value moved here
+    x;
+    //~^ ERROR cannot move out of `x` because it is borrowed
+    //~| move out of `x` occurs here
 
     let y = Int(2);
-    //~^ HELP make this binding mutable
+    //~^ HELP consider changing this to be mutable
     //~| SUGGESTION mut y
-    y   //~ error: cannot borrow immutable local variable `y` as mutable
-        //~| cannot borrow
+    y   //~ ERROR cannot borrow `y` as mutable, as it is not declared as mutable
+        //~| cannot borrow as mutable
     +=
     Int(1);
 }