@@ -20,6 +20,29 @@ LL | x.clone(); //~ ERROR: use of moved value
2020 |
2121 = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
2222
23+ error[E0505]: cannot move out of `x` because it is borrowed
24+ --> $DIR/binop-move-semantics.rs:31:5
25+ |
26+ LL | let m = &x;
27+ | -- borrow of `x` occurs here
28+ ...
29+ LL | x //~ ERROR: cannot move out of `x` because it is borrowed
30+ | ^ move out of `x` occurs here
31+ ...
32+ LL | use_mut(n); use_imm(m);
33+ | - borrow later used here
34+
35+ error[E0505]: cannot move out of `y` because it is borrowed
36+ --> $DIR/binop-move-semantics.rs:33:5
37+ |
38+ LL | let n = &mut y;
39+ | ------ borrow of `y` occurs here
40+ ...
41+ LL | y; //~ ERROR: cannot move out of `y` because it is borrowed
42+ | ^ move out of `y` occurs here
43+ LL | use_mut(n); use_imm(m);
44+ | - borrow later used here
45+
2346error[E0507]: cannot move out of borrowed content
2447 --> $DIR/binop-move-semantics.rs:40:5
2548 |
@@ -62,7 +85,7 @@ LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also b
6285 | | immutable borrow later used here
6386 | mutable borrow occurs here
6487
65- error: aborting due to 6 previous errors
88+ error: aborting due to 8 previous errors
6689
67- Some errors occurred: E0382, E0502, E0507.
90+ Some errors occurred: E0382, E0502, E0505, E0507.
6891For more information about an error, try `rustc --explain E0382`.
0 commit comments