rust/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr

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

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-03-07 16:26:52 -06:00
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:11:5
|
LL | a: String,
| ^^^^^^^^^
|
2023-03-07 16:26:52 -06:00
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
2021-11-14 05:04:25 -06:00
LL | a: std::mem::ManuallyDrop<String>,
2021-11-14 21:47:36 -06:00
| +++++++++++++++++++++++ +
2023-03-07 16:26:52 -06:00
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:19:5
|
LL | a: S,
| ^^^^
|
2023-03-07 16:26:52 -06:00
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
2021-11-14 05:04:25 -06:00
LL | a: std::mem::ManuallyDrop<S>,
2021-11-14 21:47:36 -06:00
| +++++++++++++++++++++++ +
2023-03-07 16:26:52 -06:00
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:24:5
|
LL | a: T,
| ^^^^
|
2023-03-07 16:26:52 -06:00
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
2021-11-14 05:04:25 -06:00
LL | a: std::mem::ManuallyDrop<T>,
2021-11-14 21:47:36 -06:00
| +++++++++++++++++++++++ +
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0740`.