error[E0503]: cannot use `y` because it was mutably borrowed
- --> $DIR/borrowck-anon-fields-variant.rs:17:7
+ --> $DIR/borrowck-anon-fields-variant.rs:16:19
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
...
-LL | Foo::Y(_, ref mut b) => b,
- | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
+LL | let b = match y {
+ | ^ use of borrowed `y.0`
...
LL | *a += 1;
| ------- borrow later used here
error[E0503]: cannot use `y` because it was mutably borrowed
- --> $DIR/borrowck-anon-fields-variant.rs:35:7
+ --> $DIR/borrowck-anon-fields-variant.rs:34:19
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
...
-LL | Foo::Y(ref mut b, _) => b,
- | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
+LL | let b = match y {
+ | ^ use of borrowed `y.0`
...
LL | *a += 1;
| ------- borrow later used here
error[E0499]: cannot borrow `y.0` as mutable more than once at a time
- --> $DIR/borrowck-anon-fields-variant.rs:35:14
+ --> $DIR/borrowck-anon-fields-variant.rs:36:14
|
LL | Foo::Y(ref mut a, _) => a,
| --------- first mutable borrow occurs here