rust/tests/ui/nll/issue-45157.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
711 B
Plaintext
Raw Normal View History

error[E0502]: cannot borrow `u` (via `u.z.c`) as immutable because it is also borrowed as mutable (via `u.s.a`)
--> $DIR/issue-45157.rs:27:20
2018-01-24 07:14:58 -06:00
|
2018-02-24 17:59:34 -06:00
LL | let mref = &mut u.s.a;
| ---------- mutable borrow occurs here (via `u.s.a`)
2018-01-24 07:14:58 -06:00
...
2018-02-24 17:59:34 -06:00
LL | let nref = &u.z.c;
| ^^^^^^ immutable borrow of `u.z.c` -- which overlaps with `u.s.a` -- occurs here
2019-03-09 06:03:44 -06:00
LL |
LL | println!("{} {}", mref, nref)
| ---- mutable borrow later used here
|
= note: `u.z.c` is a field of the union `U`, so it overlaps the field `u.s.a`
2018-01-24 07:14:58 -06:00
error: aborting due to previous error
2018-01-24 07:14:58 -06:00
2018-03-03 08:59:40 -06:00
For more information about this error, try `rustc --explain E0502`.