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

21 lines
718 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:14:14
2020-08-16 03:07:33 -05:00
|
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: not automatically applying `DerefMut` on union field
--> $DIR/union-deref.rs:18:14
|
LL | unsafe { u.f.0.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 2 previous errors
2020-08-16 03:07:33 -05:00