rust/src/test/ui/union/union-deref.stderr

12 lines
374 B
Plaintext
Raw Normal View History

2020-08-16 03:07:33 -05:00
error: not automatically applying `DerefMut` on union field
--> $DIR/union-deref.rs:12:14
|
LL | unsafe { u.f.0 = Vec::new() };
| ^^^
|
= help: writing to this field calls the destructor for the old value
= help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
error: aborting due to previous error