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