1 error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x.0`)
2 --> $DIR/union-borrow-move-parent-sibling.rs:56:13
4 LL | let a = &mut u.x.0;
5 | ---------- mutable borrow occurs here (via `u.x.0`)
7 | ^^^^ immutable borrow of `u.y` -- which overlaps with `u.x.0` -- occurs here
9 | - mutable borrow later used here
11 = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x.0`
13 error[E0382]: use of moved value: `u`
14 --> $DIR/union-borrow-move-parent-sibling.rs:63:13
16 LL | let u = U { x: ((MockVec::new(), MockVec::new()), MockVec::new()) };
17 | - move occurs because `u` has type `U`, which does not implement the `Copy` trait
19 | ----- value moved here
21 | ^^^ value used here after move
23 error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x.0.0`)
24 --> $DIR/union-borrow-move-parent-sibling.rs:69:13
26 LL | let a = &mut (u.x.0).0;
27 | -------------- mutable borrow occurs here (via `u.x.0.0`)
29 | ^^^^ immutable borrow of `u.y` -- which overlaps with `u.x.0.0` -- occurs here
31 | - mutable borrow later used here
33 = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x.0.0`
35 error[E0382]: use of moved value: `u`
36 --> $DIR/union-borrow-move-parent-sibling.rs:76:13
38 LL | let u = U { x: ((MockVec::new(), MockVec::new()), MockVec::new()) };
39 | - move occurs because `u` has type `U`, which does not implement the `Copy` trait
40 LL | let a = (u.x.0).0;
41 | --------- value moved here
43 | ^^^ value used here after move
45 error[E0502]: cannot borrow `u` (via `u.x`) as immutable because it is also borrowed as mutable (via `u.y`)
46 --> $DIR/union-borrow-move-parent-sibling.rs:82:13
48 LL | let a = &mut *u.y;
49 | --- mutable borrow occurs here (via `u.y`)
51 | ^^^^ immutable borrow of `u.x` -- which overlaps with `u.y` -- occurs here
53 | - mutable borrow later used here
55 = note: `u.x` is a field of the union `U`, so it overlaps the field `u.y`
57 error: aborting due to 5 previous errors
59 Some errors have detailed explanations: E0382, E0502.
60 For more information about an error, try `rustc --explain E0382`.