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