]> git.proxmox.com Git - rustc.git/blame - src/test/ui/unop-move-semantics.stderr
New upstream version 1.56.0~beta.4+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) {
74b04a01 5 | - move occurs because `x` has type `T`, which does not implement the `Copy` trait
b7449926 6LL | !x;
f035d41b 7 | -- `x` moved due to usage in operator
b7449926 8LL |
532ac7d7 9LL | x.clone();
48663c56 10 | ^ value borrowed here after move
74b04a01 11 |
f035d41b 12note: calling this operator moves the left-hand side
3dfed10e 13 --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
f035d41b
XL
14 |
15LL | fn not(self) -> Self::Output;
16 | ^^^^
ba9703b0 17help: consider further restricting this bound
74b04a01 18 |
ba9703b0 19LL | fn move_then_borrow<T: Not<Output=T> + Clone + Copy>(x: T) {
94222f64 20 | ++++++
b7449926
XL
21
22error[E0505]: cannot move out of `x` because it is borrowed
0731742a 23 --> $DIR/unop-move-semantics.rs:15:6
b7449926
XL
24 |
25LL | let m = &x;
48663c56 26 | -- borrow of `x` occurs here
b7449926 27...
532ac7d7 28LL | !x;
b7449926 29 | ^ move out of `x` occurs here
48663c56
XL
30...
31LL | use_mut(n); use_imm(m);
32 | - borrow later used here
b7449926
XL
33
34error[E0505]: cannot move out of `y` because it is borrowed
0731742a 35 --> $DIR/unop-move-semantics.rs:17:6
b7449926
XL
36 |
37LL | let n = &mut y;
48663c56 38 | ------ borrow of `y` occurs here
b7449926 39...
532ac7d7 40LL | !y;
b7449926 41 | ^ move out of `y` occurs here
48663c56
XL
42LL | use_mut(n); use_imm(m);
43 | - borrow later used here
b7449926 44
dc9dc135 45error[E0507]: cannot move out of `*m` which is behind a mutable reference
0731742a 46 --> $DIR/unop-move-semantics.rs:24:6
b7449926 47 |
532ac7d7 48LL | !*m;
dc9dc135 49 | ^^ move occurs because `*m` has type `T`, which does not implement the `Copy` trait
b7449926 50
dc9dc135 51error[E0507]: cannot move out of `*n` which is behind a shared reference
0731742a 52 --> $DIR/unop-move-semantics.rs:26:6
b7449926 53 |
532ac7d7 54LL | !*n;
dc9dc135 55 | ^^ move occurs because `*n` has type `T`, which does not implement the `Copy` trait
b7449926
XL
56
57error: aborting due to 5 previous errors
58
48663c56 59Some errors have detailed explanations: E0382, E0505, E0507.
b7449926 60For more information about an error, try `rustc --explain E0382`.