]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binop/binop-move-semantics.stderr
Rollup merge of #59116 - estebank:comma-sugg, r=petrochenkov
[rust.git] / src / test / ui / binop / binop-move-semantics.stderr
1 error[E0382]: use of moved value: `x`
2   --> $DIR/binop-move-semantics.rs:8:5
3    |
4 LL |     x
5    |     - value moved here
6 LL |     +
7 LL |     x;
8    |     ^ value used here after move
9    |
10    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
11
12 error[E0382]: use of moved value: `x`
13   --> $DIR/binop-move-semantics.rs:14:5
14    |
15 LL |     x
16    |     - value moved here
17 LL |     +
18 LL |     x.clone();
19    |     ^ value used here after move
20    |
21    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
22
23 error[E0505]: cannot move out of `x` because it is borrowed
24   --> $DIR/binop-move-semantics.rs:21:5
25    |
26 LL |     let m = &x;
27    |              - borrow of `x` occurs here
28 ...
29 LL |     x
30    |     ^ move out of `x` occurs here
31
32 error[E0505]: cannot move out of `y` because it is borrowed
33   --> $DIR/binop-move-semantics.rs:23:5
34    |
35 LL |     let n = &mut y;
36    |                  - borrow of `y` occurs here
37 ...
38 LL |     y;
39    |     ^ move out of `y` occurs here
40
41 error[E0507]: cannot move out of borrowed content
42   --> $DIR/binop-move-semantics.rs:30:5
43    |
44 LL |     *m
45    |     ^^ cannot move out of borrowed content
46
47 error[E0507]: cannot move out of borrowed content
48   --> $DIR/binop-move-semantics.rs:32:5
49    |
50 LL |     *n;
51    |     ^^ cannot move out of borrowed content
52
53 error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
54   --> $DIR/binop-move-semantics.rs:54:6
55    |
56 LL |     &mut f
57    |          - mutable borrow occurs here
58 LL |     +
59 LL |     &f;
60    |      ^
61    |      |
62    |      immutable borrow occurs here
63    |      mutable borrow ends here
64
65 error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable
66   --> $DIR/binop-move-semantics.rs:62:10
67    |
68 LL |     &f
69    |      - immutable borrow occurs here
70 LL |     +
71 LL |     &mut f;
72    |          ^
73    |          |
74    |          mutable borrow occurs here
75    |          immutable borrow ends here
76
77 error: aborting due to 8 previous errors
78
79 Some errors occurred: E0382, E0502, E0505, E0507.
80 For more information about an error, try `rustc --explain E0382`.