1 error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`)
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`)
7 | ^^^^ immutable borrow of `u.y` -- which overlaps with `u.x` -- 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`
13 error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec<u8>, MockVec<u8>), MockVec<u8>)>`
14 --> $DIR/union-borrow-move-parent-sibling.rs:62:13
17 | ^^^^^ move occurs because value has type `(MockVec<u8>, MockVec<u8>)`, which does not implement the `Copy` trait
19 help: consider borrowing here
24 error[E0382]: use of moved value: `u`
25 --> $DIR/union-borrow-move-parent-sibling.rs:64:13
27 LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) };
28 | - move occurs because `u` has type `U`, which does not implement the `Copy` trait
31 | --- value moved here
33 | ^^^ value used here after move
35 error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`)
36 --> $DIR/union-borrow-move-parent-sibling.rs:70:13
38 LL | let a = &mut ((*u.x).0).0;
39 | --- mutable borrow occurs here (via `u.x`)
41 | ^^^^ immutable borrow of `u.y` -- which overlaps with `u.x` -- occurs here
43 | - mutable borrow later used here
45 = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x`
47 error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec<u8>, MockVec<u8>), MockVec<u8>)>`
48 --> $DIR/union-borrow-move-parent-sibling.rs:76:13
50 LL | let a = (u.x.0).0;
51 | ^^^^^^^^^ move occurs because value has type `MockVec<u8>`, which does not implement the `Copy` trait
53 help: consider borrowing here
55 LL | let a = &(u.x.0).0;
58 error[E0382]: use of moved value: `u`
59 --> $DIR/union-borrow-move-parent-sibling.rs:78:13
61 LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) };
62 | - move occurs because `u` has type `U`, which does not implement the `Copy` trait
63 LL | let a = (u.x.0).0;
65 | --- value moved here
67 | ^^^ value used here after move
69 error[E0502]: cannot borrow `u` (via `u.x`) as immutable because it is also borrowed as mutable (via `u.y`)
70 --> $DIR/union-borrow-move-parent-sibling.rs:84:13
72 LL | let a = &mut *u.y;
73 | --- mutable borrow occurs here (via `u.y`)
75 | ^^^^ immutable borrow of `u.x` -- which overlaps with `u.y` -- occurs here
77 | - mutable borrow later used here
79 = note: `u.x` is a field of the union `U`, so it overlaps the field `u.y`
81 error: aborting due to 7 previous errors
83 Some errors have detailed explanations: E0382, E0502, E0507.
84 For more information about an error, try `rustc --explain E0382`.