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