]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/augmented-assignments.nll.stderr
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / augmented-assignments.nll.stderr
index deb2e7ed4a33dfaeee88d3d1ed071128ce3fb7cc..57a86227f764d104d6dfa82b593dbc80eeee2f81 100644 (file)
@@ -14,9 +14,12 @@ LL | |     x;  //~ value moved here
    | |_____move out of `x` occurs here
    |       borrow later used here
 
-error[E0596]: cannot borrow immutable item `y` as mutable
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/augmented-assignments.rs:30:5
    |
+LL |     let y = Int(2);
+   |         - help: consider changing this to be mutable: `mut y`
+LL |     //~^ consider changing this to `mut y`
 LL |     y   //~ error: cannot borrow immutable local variable `y` as mutable
    |     ^ cannot borrow as mutable