@@ -9,6 +9,29 @@ LL | x.clone(); //~ ERROR: use of moved value
99 |
1010 = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
1111
12+ error[E0505]: cannot move out of `x` because it is borrowed
13+ --> $DIR/unop-move-semantics.rs:25:6
14+ |
15+ LL | let m = &x;
16+ | -- borrow of `x` occurs here
17+ ...
18+ LL | !x; //~ ERROR: cannot move out of `x` because it is borrowed
19+ | ^ move out of `x` occurs here
20+ ...
21+ LL | use_mut(n); use_imm(m);
22+ | - borrow later used here
23+
24+ error[E0505]: cannot move out of `y` because it is borrowed
25+ --> $DIR/unop-move-semantics.rs:27:6
26+ |
27+ LL | let n = &mut y;
28+ | ------ borrow of `y` occurs here
29+ ...
30+ LL | !y; //~ ERROR: cannot move out of `y` because it is borrowed
31+ | ^ move out of `y` occurs here
32+ LL | use_mut(n); use_imm(m);
33+ | - borrow later used here
34+
1235error[E0507]: cannot move out of borrowed content
1336 --> $DIR/unop-move-semantics.rs:34:6
1437 |
@@ -21,7 +44,7 @@ error[E0507]: cannot move out of borrowed content
2144LL | !*n; //~ ERROR: cannot move out of borrowed content
2245 | ^^ cannot move out of borrowed content
2346
24- error: aborting due to 3 previous errors
47+ error: aborting due to 5 previous errors
2548
26- Some errors occurred: E0382, E0507.
49+ Some errors occurred: E0382, E0505, E0507.
2750For more information about an error, try `rustc --explain E0382`.
0 commit comments