@@ -9,6 +9,29 @@ LL | x.clone(); //~ ERROR: use of moved value
9
9
|
10
10
= note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
11
11
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
+
12
35
error[E0507]: cannot move out of borrowed content
13
36
--> $DIR/unop-move-semantics.rs:34:6
14
37
|
@@ -21,7 +44,7 @@ error[E0507]: cannot move out of borrowed content
21
44
LL | !*n; //~ ERROR: cannot move out of borrowed content
22
45
| ^^ cannot move out of borrowed content
23
46
24
- error: aborting due to 3 previous errors
47
+ error: aborting due to 5 previous errors
25
48
26
- Some errors occurred: E0382, E0507.
49
+ Some errors occurred: E0382, E0505, E0507.
27
50
For more information about an error, try `rustc --explain E0382`.
0 commit comments