fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
711 B17 linesraw
1error[E0502]: cannot borrow `u` (via `u.z.c`) as immutable because it is also borrowed as mutable (via `u.s.a`)
2  --> $DIR/issue-45157.rs:27:20
3   |
4LL |         let mref = &mut u.s.a;
5   |                    ---------- mutable borrow occurs here (via `u.s.a`)
6...
7LL |         let nref = &u.z.c;
8   |                    ^^^^^^ immutable borrow of `u.z.c` -- which overlaps with `u.s.a` -- occurs here
9LL |
10LL |         println!("{} {}", mref, nref)
11   |                           ---- mutable borrow later used here
12   |
13   = note: `u.z.c` is a field of the union `U`, so it overlaps the field `u.s.a`
14
15error: aborting due to previous error
16
17For more information about this error, try `rustc --explain E0502`.