]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | error[E0503]: cannot use `foo` because it was mutably borrowed |
2 | --> $DIR/borrowck-match-already-borrowed.rs:23:9 | |
3 | | | |
4 | LL | let p = &mut foo; | |
5 | | -------- borrow of `foo` occurs here | |
0bf4aa26 | 6 | LL | let _ = match foo { |
b7449926 XL |
7 | LL | Foo::B => 1, //[mir]~ ERROR [E0503] |
8 | | ^^^^^^ use of borrowed `foo` | |
9 | ... | |
10 | LL | drop(p); | |
11 | | - borrow later used here | |
12 | ||
13 | error[E0503]: cannot use `foo.0` because it was mutably borrowed | |
14 | --> $DIR/borrowck-match-already-borrowed.rs:25:16 | |
15 | | | |
16 | LL | let p = &mut foo; | |
17 | | -------- borrow of `foo` occurs here | |
18 | ... | |
19 | LL | Foo::A(x) => x //[ast]~ ERROR [E0503] | |
20 | | ^ use of borrowed `foo` | |
21 | ... | |
22 | LL | drop(p); | |
23 | | - borrow later used here | |
24 | ||
b7449926 XL |
25 | error[E0503]: cannot use `x` because it was mutably borrowed |
26 | --> $DIR/borrowck-match-already-borrowed.rs:36:9 | |
27 | | | |
28 | LL | let r = &mut x; | |
29 | | ------ borrow of `x` occurs here | |
0bf4aa26 | 30 | LL | let _ = match x { |
b7449926 XL |
31 | LL | x => x + 1, //[ast]~ ERROR [E0503] |
32 | | ^ use of borrowed `x` | |
33 | ... | |
34 | LL | drop(r); | |
35 | | - borrow later used here | |
36 | ||
37 | error[E0503]: cannot use `x` because it was mutably borrowed | |
38 | --> $DIR/borrowck-match-already-borrowed.rs:38:9 | |
39 | | | |
40 | LL | let r = &mut x; | |
41 | | ------ borrow of `x` occurs here | |
42 | ... | |
43 | LL | y => y + 2, //[ast]~ ERROR [E0503] | |
44 | | ^ use of borrowed `x` | |
45 | ... | |
46 | LL | drop(r); | |
47 | | - borrow later used here | |
48 | ||
0bf4aa26 | 49 | error: aborting due to 4 previous errors |
b7449926 XL |
50 | |
51 | For more information about this error, try `rustc --explain E0503`. |