]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-anon-fields-variant.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-anon-fields-variant.stderr
1 error[E0503]: cannot use `y` because it was mutably borrowed
2   --> $DIR/borrowck-anon-fields-variant.rs:16:19
3    |
4 LL |       Foo::Y(ref mut a, _) => a,
5    |              --------- borrow of `y.0` occurs here
6 ...
7 LL |     let b = match y {
8    |                   ^ use of borrowed `y.0`
9 ...
10 LL |     *a += 1;
11    |     ------- borrow later used here
12
13 error[E0503]: cannot use `y` because it was mutably borrowed
14   --> $DIR/borrowck-anon-fields-variant.rs:34:19
15    |
16 LL |       Foo::Y(ref mut a, _) => a,
17    |              --------- borrow of `y.0` occurs here
18 ...
19 LL |     let b = match y {
20    |                   ^ use of borrowed `y.0`
21 ...
22 LL |     *a += 1;
23    |     ------- borrow later used here
24
25 error[E0499]: cannot borrow `y.0` as mutable more than once at a time
26   --> $DIR/borrowck-anon-fields-variant.rs:36:14
27    |
28 LL |       Foo::Y(ref mut a, _) => a,
29    |              --------- first mutable borrow occurs here
30 ...
31 LL |       Foo::Y(ref mut b, _) => b,
32    |              ^^^^^^^^^ second mutable borrow occurs here
33 ...
34 LL |     *a += 1;
35    |     ------- first borrow later used here
36
37 error: aborting due to 3 previous errors
38
39 Some errors have detailed explanations: E0499, E0503.
40 For more information about an error, try `rustc --explain E0499`.