fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.3 KiB63 linesraw
1error: cannot move out of value because it is borrowed
2  --> $DIR/default-binding-modes-both-sides-independent.rs:26:9
3   |
4LL |     let ref a @ b = NotCopy;
5   |         ^^^^^   - value is moved into `b` here
6   |         |
7   |         value is borrowed by `a` here
8
9error: cannot move out of value because it is borrowed
10  --> $DIR/default-binding-modes-both-sides-independent.rs:29:9
11   |
12LL |     let ref mut a @ b = NotCopy;
13   |         ^^^^^^^^^   - value is moved into `b` here
14   |         |
15   |         value is mutably borrowed by `a` here
16
17error: cannot move out of value because it is borrowed
18  --> $DIR/default-binding-modes-both-sides-independent.rs:34:12
19   |
20LL |         Ok(ref a @ b) | Err(b @ ref a) => {
21   |            ^^^^^   - value is moved into `b` here
22   |            |
23   |            value is borrowed by `a` here
24
25error: borrow of moved value
26  --> $DIR/default-binding-modes-both-sides-independent.rs:34:29
27   |
28LL |         Ok(ref a @ b) | Err(b @ ref a) => {
29   |                             ^   ----- value borrowed here after move
30   |                             |
31   |                             value moved into `b` here
32   |                             move occurs because `b` has type `NotCopy` which does not implement the `Copy` trait
33   |
34help: borrow this binding in the pattern to avoid moving the value
35   |
36LL |         Ok(ref a @ b) | Err(ref b @ ref a) => {
37   |                             +++
38
39error: cannot move out of value because it is borrowed
40  --> $DIR/default-binding-modes-both-sides-independent.rs:42:9
41   |
42LL |         ref a @ b => {
43   |         ^^^^^   - value is moved into `b` here
44   |         |
45   |         value is borrowed by `a` here
46
47error[E0382]: borrow of moved value
48  --> $DIR/default-binding-modes-both-sides-independent.rs:29:9
49   |
50LL |     let ref mut a @ b = NotCopy;
51   |         ^^^^^^^^^   -   ------- move occurs because value has type `NotCopy`, which does not implement the `Copy` trait
52   |         |           |
53   |         |           value moved here
54   |         value borrowed here after move
55   |
56help: borrow this binding in the pattern to avoid moving the value
57   |
58LL |     let ref mut a @ ref b = NotCopy;
59   |                     +++
60
61error: aborting due to 6 previous errors
62
63For more information about this error, try `rustc --explain E0382`.