1 error[E0502]: cannot borrow `u.y` as immutable because `u.x.0` is also borrowed as mutable
2 --> $DIR/union-borrow-move-parent-sibling.rs:15:14
4 LL | let a = &mut u.x.0;
5 | ----- mutable borrow occurs here
6 LL | let b = &u.y; //~ ERROR cannot borrow `u.y`
7 | ^^^ immutable borrow occurs here
10 | - mutable borrow ends here
12 error[E0382]: use of moved value: `u.y`
13 --> $DIR/union-borrow-move-parent-sibling.rs:22:9
17 LL | let b = u.y; //~ ERROR use of moved value: `u.y`
18 | ^ value used here after move
20 = note: move occurs because `u.y` has type `[type error]`, which does not implement the `Copy` trait
22 error[E0502]: cannot borrow `u.y` as immutable because `u.x.0.0` is also borrowed as mutable
23 --> $DIR/union-borrow-move-parent-sibling.rs:28:14
25 LL | let a = &mut (u.x.0).0;
26 | --------- mutable borrow occurs here
27 LL | let b = &u.y; //~ ERROR cannot borrow `u.y`
28 | ^^^ immutable borrow occurs here
31 | - mutable borrow ends here
33 error[E0382]: use of moved value: `u.y`
34 --> $DIR/union-borrow-move-parent-sibling.rs:35:9
36 LL | let a = (u.x.0).0;
38 LL | let b = u.y; //~ ERROR use of moved value: `u.y`
39 | ^ value used here after move
41 = note: move occurs because `u.y` has type `[type error]`, which does not implement the `Copy` trait
43 error[E0502]: cannot borrow `u` (via `u.x`) as immutable because `u` is also borrowed as mutable (via `*u.y`)
44 --> $DIR/union-borrow-move-parent-sibling.rs:41:14
46 LL | let a = &mut *u.y;
47 | ---- mutable borrow occurs here (via `*u.y`)
48 LL | let b = &u.x; //~ ERROR cannot borrow `u` (via `u.x`)
49 | ^^^ immutable borrow occurs here (via `u.x`)
52 | - mutable borrow ends here
54 error[E0382]: use of moved value: `u.x`
55 --> $DIR/union-borrow-move-parent-sibling.rs:48:9
59 LL | let b = u.x; //~ ERROR use of moved value: `u.x`
60 | ^ value used here after move
62 = note: move occurs because `u.x` has type `[type error]`, which does not implement the `Copy` trait
64 error: aborting due to 6 previous errors
66 Some errors occurred: E0382, E0502.
67 For more information about an error, try `rustc --explain E0382`.