]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binop/binop-move-semantics.nll.stderr
Rollup merge of #55469 - pnkfelix:issue-54477-regression-tests, r=nikomatsakis
[rust.git] / src / test / ui / binop / binop-move-semantics.nll.stderr
1 error[E0382]: use of moved value: `x`
2   --> $DIR/binop-move-semantics.rs:18:5
3    |
4 LL |     x
5    |     - value moved here
6 LL |     +
7 LL |     x;  //~ ERROR: use of moved value
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]: borrow of moved value: `x`
13   --> $DIR/binop-move-semantics.rs:24:5
14    |
15 LL |     x
16    |     - value moved here
17 LL |     +
18 LL |     x.clone();  //~ ERROR: use of moved value
19    |     ^ value borrowed here after move
20    |
21    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
22
23 error[E0507]: cannot move out of borrowed content
24   --> $DIR/binop-move-semantics.rs:40:5
25    |
26 LL |     *m  //~ ERROR: cannot move out of borrowed content
27    |     ^^ cannot move out of borrowed content
28
29 error[E0507]: cannot move out of borrowed content
30   --> $DIR/binop-move-semantics.rs:42:5
31    |
32 LL |     *n;  //~ ERROR: cannot move out of borrowed content
33    |     ^^ cannot move out of borrowed content
34
35 error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
36   --> $DIR/binop-move-semantics.rs:64:5
37    |
38 LL |       &mut f
39    |       ------
40    |       |
41    |  _____mutable borrow occurs here
42    | |
43 LL | |     +
44 LL | |     &f;  //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
45    | |     ^-
46    | |_____||
47    |       |mutable borrow later used here
48    |       immutable borrow occurs here
49
50 error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable
51   --> $DIR/binop-move-semantics.rs:72:5
52    |
53 LL |       &f
54    |       --
55    |       |
56    |  _____immutable borrow occurs here
57    | |
58 LL | |     +
59 LL | |     &mut f;  //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
60    | |     ^^^^^-
61    | |_____|____|
62    |       |    immutable borrow later used here
63    |       mutable borrow occurs here
64
65 error: aborting due to 6 previous errors
66
67 Some errors occurred: E0382, E0502, E0507.
68 For more information about an error, try `rustc --explain E0382`.