@@ -20,6 +20,29 @@ LL | x.clone(); //~ ERROR: use of moved value
20
20
|
21
21
= note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
22
22
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
+
23
46
error[E0507]: cannot move out of borrowed content
24
47
--> $DIR/binop-move-semantics.rs:40:5
25
48
|
@@ -62,7 +85,7 @@ LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also b
62
85
| | immutable borrow later used here
63
86
| mutable borrow occurs here
64
87
65
- error: aborting due to 6 previous errors
88
+ error: aborting due to 8 previous errors
66
89
67
- Some errors occurred: E0382, E0502, E0507.
90
+ Some errors occurred: E0382, E0502, E0505, E0507.
68
91
For more information about an error, try `rustc --explain E0382`.
0 commit comments