fork/rust

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

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

master
1.5 KiB52 linesraw
1error[E0503]: cannot use `e` because it was mutably borrowed
2  --> $DIR/match-on-borrowed.rs:47:11
3   |
4LL |         E::V(ref mut x, _) => x,
5   |              --------- `e.0` is borrowed here
6...
7LL |     match e { // Don't know that E uses a tag for its discriminant
8   |           ^ use of borrowed `e.0`
9...
10LL |     x;
11   |     - borrow later used here
12
13error[E0503]: cannot use `*f` because it was mutably borrowed
14  --> $DIR/match-on-borrowed.rs:61:11
15   |
16LL |         E::V(ref mut x, _) => x,
17   |              --------- `f.0` is borrowed here
18...
19LL |     match f { // Don't know that E uses a tag for its discriminant
20   |           ^ use of borrowed `f.0`
21...
22LL |     x;
23   |     - borrow later used here
24
25error[E0503]: cannot use `t` because it was mutably borrowed
26  --> $DIR/match-on-borrowed.rs:81:5
27   |
28LL |     let x = &mut t;
29   |             ------ `t` is borrowed here
30LL |     match t {
31   |     ^^^^^^^ use of borrowed `t`
32...
33LL |     x;
34   |     - borrow later used here
35
36error[E0381]: used binding `n` isn't initialized
37  --> $DIR/match-on-borrowed.rs:93:11
38   |
39LL |     let n: Never;
40   |         - binding declared here but left uninitialized
41LL |     match n {}
42   |           ^ `n` used here but it isn't initialized
43   |
44help: consider assigning a value
45   |
46LL |     let n: Never = todo!();
47   |                  +++++++++
48
49error: aborting due to 4 previous errors
50
51Some errors have detailed explanations: E0381, E0503.
52For more information about an error, try `rustc --explain E0381`.