]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-with-drop-fields.thirunsafeck.stderr
Improve ManuallyDrop suggestion
[rust.git] / src / test / ui / union / union-with-drop-fields.thirunsafeck.stderr
1 error[E0740]: unions may not contain fields that need dropping
2   --> $DIR/union-with-drop-fields.rs:11:5
3    |
4 LL |     a: String,
5    |     ^^^^^^^^^
6    |
7 help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped
8    |
9 LL |     a: std::mem::ManuallyDrop<String>,
10    |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
12 error[E0740]: unions may not contain fields that need dropping
13   --> $DIR/union-with-drop-fields.rs:19:5
14    |
15 LL |     a: S,
16    |     ^^^^
17    |
18 help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped
19    |
20 LL |     a: std::mem::ManuallyDrop<S>,
21    |        ~~~~~~~~~~~~~~~~~~~~~~~~~
22
23 error[E0740]: unions may not contain fields that need dropping
24   --> $DIR/union-with-drop-fields.rs:24:5
25    |
26 LL |     a: T,
27    |     ^^^^
28    |
29 help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped
30    |
31 LL |     a: std::mem::ManuallyDrop<T>,
32    |        ~~~~~~~~~~~~~~~~~~~~~~~~~
33
34 error: aborting due to 3 previous errors
35
36 For more information about this error, try `rustc --explain E0740`.