]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/issue-45157.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / issue-45157.stderr
1 error[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    |
4 LL |         let mref = &mut u.s.a;
5    |                    ---------- mutable borrow occurs here (via `u.s.a`)
6 ...
7 LL |         let nref = &u.z.c;
8    |                    ^^^^^^ immutable borrow of `u.z.c` -- which overlaps with `u.s.a` -- occurs here
9 LL |
10 LL |         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
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0502`.