]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-match-already-borrowed.stderr
Merge commit '9809f5d21990d9e24b3e9876ea7da756fd4e9def' into libgccjit-codegen
[rust.git] / src / test / ui / borrowck / borrowck-match-already-borrowed.stderr
1 error[E0503]: cannot use `foo` because it was mutably borrowed
2   --> $DIR/borrowck-match-already-borrowed.rs:10:9
3    |
4 LL |     let p = &mut foo;
5    |             -------- borrow of `foo` occurs here
6 LL |     let _ = match foo {
7 LL |         Foo::B => 1,
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:12:16
15    |
16 LL |     let p = &mut foo;
17    |             -------- borrow of `foo` occurs here
18 ...
19 LL |         Foo::A(x) => x
20    |                ^ use of borrowed `foo`
21 LL |     };
22 LL |     drop(p);
23    |          - borrow later used here
24
25 error[E0503]: cannot use `x` because it was mutably borrowed
26   --> $DIR/borrowck-match-already-borrowed.rs:22:9
27    |
28 LL |     let r = &mut x;
29    |             ------ borrow of `x` occurs here
30 LL |     let _ = match x {
31 LL |         x => x + 1,
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:23:9
39    |
40 LL |     let r = &mut x;
41    |             ------ borrow of `x` occurs here
42 ...
43 LL |         y => y + 2,
44    |         ^ use of borrowed `x`
45 LL |     };
46 LL |     drop(r);
47    |          - borrow later used here
48
49 error: aborting due to 4 previous errors
50
51 For more information about this error, try `rustc --explain E0503`.