fork/rust

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

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

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