]>
Commit | Line | Data |
---|---|---|
48663c56 | 1 | error[E0382]: borrow of moved value: `x` |
0731742a | 2 | --> $DIR/unop-move-semantics.rs:8:5 |
b7449926 | 3 | | |
48663c56 | 4 | LL | fn move_then_borrow<T: Not<Output=T> + Clone>(x: T) { |
60c5eb7d | 5 | | -- - move occurs because `x` has type `T`, which does not implement the `Copy` trait |
48663c56 | 6 | | | |
60c5eb7d | 7 | | help: consider further restricting this bound: `T: Copy +` |
b7449926 XL |
8 | LL | !x; |
9 | | - value moved here | |
10 | LL | | |
532ac7d7 | 11 | LL | x.clone(); |
48663c56 | 12 | | ^ value borrowed here after move |
b7449926 XL |
13 | |
14 | error[E0505]: cannot move out of `x` because it is borrowed | |
0731742a | 15 | --> $DIR/unop-move-semantics.rs:15:6 |
b7449926 XL |
16 | | |
17 | LL | let m = &x; | |
48663c56 | 18 | | -- borrow of `x` occurs here |
b7449926 | 19 | ... |
532ac7d7 | 20 | LL | !x; |
b7449926 | 21 | | ^ move out of `x` occurs here |
48663c56 XL |
22 | ... |
23 | LL | use_mut(n); use_imm(m); | |
24 | | - borrow later used here | |
b7449926 XL |
25 | |
26 | error[E0505]: cannot move out of `y` because it is borrowed | |
0731742a | 27 | --> $DIR/unop-move-semantics.rs:17:6 |
b7449926 XL |
28 | | |
29 | LL | let n = &mut y; | |
48663c56 | 30 | | ------ borrow of `y` occurs here |
b7449926 | 31 | ... |
532ac7d7 | 32 | LL | !y; |
b7449926 | 33 | | ^ move out of `y` occurs here |
48663c56 XL |
34 | LL | use_mut(n); use_imm(m); |
35 | | - borrow later used here | |
b7449926 | 36 | |
dc9dc135 | 37 | error[E0507]: cannot move out of `*m` which is behind a mutable reference |
0731742a | 38 | --> $DIR/unop-move-semantics.rs:24:6 |
b7449926 | 39 | | |
532ac7d7 | 40 | LL | !*m; |
dc9dc135 | 41 | | ^^ move occurs because `*m` has type `T`, which does not implement the `Copy` trait |
b7449926 | 42 | |
dc9dc135 | 43 | error[E0507]: cannot move out of `*n` which is behind a shared reference |
0731742a | 44 | --> $DIR/unop-move-semantics.rs:26:6 |
b7449926 | 45 | | |
532ac7d7 | 46 | LL | !*n; |
dc9dc135 | 47 | | ^^ move occurs because `*n` has type `T`, which does not implement the `Copy` trait |
b7449926 XL |
48 | |
49 | error: aborting due to 5 previous errors | |
50 | ||
48663c56 | 51 | Some errors have detailed explanations: E0382, E0505, E0507. |
b7449926 | 52 | For more information about an error, try `rustc --explain E0382`. |