rust/src/test/ui/augmented-assignments.nll.stderr

30 lines
897 B
Plaintext
Raw Normal View History

error[E0505]: cannot move out of `x` because it is borrowed
2018-12-25 09:56:47 -06:00
--> $DIR/augmented-assignments.rs:16:5
|
LL | x //~ error: use of moved value: `x`
| -
| |
| _____borrow of `x` occurs here
| |
LL | | //~^ value used here after move
LL | | +=
LL | | x; //~ value moved here
| | -
| | |
| |_____move out of `x` occurs here
| borrow later used here
error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
2018-12-25 09:56:47 -06:00
--> $DIR/augmented-assignments.rs:21:5
|
LL | let y = Int(2);
| - help: consider changing this to be mutable: `mut y`
...
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
| ^ cannot borrow as mutable
error: aborting due to 2 previous errors
Some errors occurred: E0505, E0596.
For more information about an error, try `rustc --explain E0505`.