rust/src/test/ui/union/union-with-drop-fields.mirunsafeck.stderr

37 lines
1.0 KiB
Plaintext
Raw Normal View History

error[E0740]: unions may not contain fields that need dropping
--> $DIR/union-with-drop-fields.rs:11:5
|
LL | a: String,
| ^^^^^^^^^
|
2021-11-14 05:04:25 -06:00
help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped
|
2021-11-14 05:04:25 -06:00
LL | a: std::mem::ManuallyDrop<String>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0740]: unions may not contain fields that need dropping
--> $DIR/union-with-drop-fields.rs:19:5
|
LL | a: S,
| ^^^^
|
2021-11-14 05:04:25 -06:00
help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped
|
2021-11-14 05:04:25 -06:00
LL | a: std::mem::ManuallyDrop<S>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0740]: unions may not contain fields that need dropping
--> $DIR/union-with-drop-fields.rs:24:5
|
LL | a: T,
| ^^^^
|
2021-11-14 05:04:25 -06:00
help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped
|
2021-11-14 05:04:25 -06:00
LL | a: std::mem::ManuallyDrop<T>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0740`.