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