]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unop-move-semantics.stderr
Extend invalid floating point literal suffix suggestion
[rust.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    |     -- `x` moved due to usage in operator
8 LL |
9 LL |     x.clone();
10    |     ^^^^^^^^^ value borrowed here after move
11    |
12 note: calling this operator moves the left-hand side
13   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
14    |
15 LL |     fn not(self) -> Self::Output;
16    |            ^^^^
17 help: consider further restricting this bound
18    |
19 LL | fn move_then_borrow<T: Not<Output=T> + Clone + Copy>(x: T) {
20    |                                              ++++++
21
22 error[E0505]: cannot move out of `x` because it is borrowed
23   --> $DIR/unop-move-semantics.rs:15:6
24    |
25 LL |     let m = &x;
26    |             -- borrow of `x` occurs here
27 ...
28 LL |     !x;
29    |      ^ move out of `x` occurs here
30 ...
31 LL |     use_mut(n); use_imm(m);
32    |                         - borrow later used here
33
34 error[E0505]: cannot move out of `y` because it is borrowed
35   --> $DIR/unop-move-semantics.rs:17:6
36    |
37 LL |     let n = &mut y;
38    |             ------ borrow of `y` occurs here
39 ...
40 LL |     !y;
41    |      ^ move out of `y` occurs here
42 LL |     use_mut(n); use_imm(m);
43    |             - borrow later used here
44
45 error[E0507]: cannot move out of `*m` which is behind a mutable reference
46   --> $DIR/unop-move-semantics.rs:24:6
47    |
48 LL |     !*m;
49    |     -^^
50    |     ||
51    |     |move occurs because `*m` has type `T`, which does not implement the `Copy` trait
52    |     `*m` moved due to usage in operator
53    |
54 note: calling this operator moves the left-hand side
55   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
56    |
57 LL |     fn not(self) -> Self::Output;
58    |            ^^^^
59
60 error[E0507]: cannot move out of `*n` which is behind a shared reference
61   --> $DIR/unop-move-semantics.rs:26:6
62    |
63 LL |     !*n;
64    |     -^^
65    |     ||
66    |     |move occurs because `*n` has type `T`, which does not implement the `Copy` trait
67    |     `*n` moved due to usage in operator
68
69 error: aborting due to 5 previous errors
70
71 Some errors have detailed explanations: E0382, E0505, E0507.
72 For more information about an error, try `rustc --explain E0382`.