2019-09-06 08:47:50 -05:00
|
|
|
error[E0503]: cannot use `y` because it was mutably borrowed
|
2021-07-23 17:55:36 -05:00
|
|
|
--> $DIR/borrowck-anon-fields-variant.rs:16:19
|
2019-04-22 02:40:08 -05:00
|
|
|
|
|
|
|
|
LL | Foo::Y(ref mut a, _) => a,
|
2023-01-14 21:06:44 -06:00
|
|
|
| --------- `y.0` is borrowed here
|
2019-04-22 02:40:08 -05:00
|
|
|
...
|
2021-07-23 17:55:36 -05:00
|
|
|
LL | let b = match y {
|
|
|
|
| ^ use of borrowed `y.0`
|
2019-04-22 02:40:08 -05:00
|
|
|
...
|
|
|
|
LL | *a += 1;
|
|
|
|
| ------- borrow later used here
|
|
|
|
|
|
|
|
error[E0503]: cannot use `y` because it was mutably borrowed
|
2021-07-23 17:55:36 -05:00
|
|
|
--> $DIR/borrowck-anon-fields-variant.rs:34:19
|
2019-04-22 02:40:08 -05:00
|
|
|
|
|
|
|
|
LL | Foo::Y(ref mut a, _) => a,
|
2023-01-14 21:06:44 -06:00
|
|
|
| --------- `y.0` is borrowed here
|
2019-04-22 02:40:08 -05:00
|
|
|
...
|
2021-07-23 17:55:36 -05:00
|
|
|
LL | let b = match y {
|
|
|
|
| ^ use of borrowed `y.0`
|
2019-04-22 02:40:08 -05:00
|
|
|
...
|
|
|
|
LL | *a += 1;
|
|
|
|
| ------- borrow later used here
|
|
|
|
|
2018-08-08 07:28:26 -05:00
|
|
|
error[E0499]: cannot borrow `y.0` as mutable more than once at a time
|
2021-07-23 17:55:36 -05:00
|
|
|
--> $DIR/borrowck-anon-fields-variant.rs:36:14
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | Foo::Y(ref mut a, _) => a,
|
|
|
|
| --------- first mutable borrow occurs here
|
|
|
|
...
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | Foo::Y(ref mut b, _) => b,
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^^^^^^^ second mutable borrow occurs here
|
|
|
|
...
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | *a += 1;
|
|
|
|
| ------- first borrow later used here
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2019-09-06 08:47:50 -05:00
|
|
|
error: aborting due to 3 previous errors
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
Some errors have detailed explanations: E0499, E0503.
|
|
|
|
For more information about an error, try `rustc --explain E0499`.
|