]> git.lizzy.rs Git - rust.git/blob - 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
1 error[E0505]: cannot move out of `x` because it is borrowed
2   --> $DIR/augmented-assignments.rs:26:5
3    |
4 LL |       x   //~ error: use of moved value: `x`
5    |       -
6    |       |
7    |  _____borrow of `x` occurs here
8    | |
9 LL | |     //~^ value used here after move
10 LL | |     +=
11 LL | |     x;  //~ value moved here
12    | |     -
13    | |     |
14    | |_____move out of `x` occurs here
15    |       borrow later used here
16
17 error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
18   --> $DIR/augmented-assignments.rs:30:5
19    |
20 LL |     let y = Int(2);
21    |         - help: consider changing this to be mutable: `mut y`
22 LL |     //~^ consider changing this to `mut y`
23 LL |     y   //~ error: cannot borrow immutable local variable `y` as mutable
24    |     ^ cannot borrow as mutable
25
26 error: aborting due to 2 previous errors
27
28 Some errors occurred: E0505, E0596.
29 For more information about an error, try `rustc --explain E0505`.