]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binop/binop-move-semantics.nll.stderr
Update output for borrowck=migrate compare mode.
[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[E0507]: cannot move out of `*n` which is behind a `&` reference
36   --> $DIR/binop-move-semantics.rs:42:5
37    |
38 LL |     let n = &y;
39    |             -- help: consider changing this to be a mutable reference: `&mut y`
40 ...
41 LL |     *n;  //~ ERROR: cannot move out of borrowed content
42    |     ^^
43    |     |
44    |     cannot move out of `*n` which is behind a `&` reference
45    |     `n` is a `&` reference, so the data it refers to cannot be moved
46
47 error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
48   --> $DIR/binop-move-semantics.rs:64:5
49    |
50 LL |       &mut f
51    |       ------
52    |       |
53    |  _____mutable borrow occurs here
54    | |
55 LL | |     +
56 LL | |     &f;  //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
57    | |     ^-
58    | |_____||
59    |       |mutable borrow later used here
60    |       immutable borrow occurs here
61
62 error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable
63   --> $DIR/binop-move-semantics.rs:72:5
64    |
65 LL |       &f
66    |       --
67    |       |
68    |  _____immutable borrow occurs here
69    | |
70 LL | |     +
71 LL | |     &mut f;  //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
72    | |     ^^^^^-
73    | |_____|____|
74    |       |    immutable borrow later used here
75    |       mutable borrow occurs here
76
77 error: aborting due to 7 previous errors
78
79 Some errors occurred: E0382, E0502, E0507.
80 For more information about an error, try `rustc --explain E0382`.