2021-10-13 16:14:37 -05:00
|
|
|
error[E0506]: cannot assign to `a.y` because it is borrowed
|
|
|
|
--> $DIR/union.rs:20:5
|
|
|
|
|
|
|
|
|
LL | let mut c = || {
|
2023-01-14 21:06:44 -06:00
|
|
|
| -- `a.y` is borrowed here
|
2021-10-13 16:14:37 -05:00
|
|
|
...
|
|
|
|
LL | let _ = &mut a;
|
|
|
|
| - borrow occurs due to use in closure
|
|
|
|
...
|
|
|
|
LL | a.y = 1;
|
2023-01-14 21:06:44 -06:00
|
|
|
| ^^^^^^^ `a.y` is assigned to here but it was already borrowed
|
2021-10-13 16:14:37 -05:00
|
|
|
...
|
|
|
|
LL | c();
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0506`.
|