]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-with-drop-fields.mirunsafeck.stderr
Rollup merge of #94113 - Mizobrook-kan:issue-94025, r=estebank
[rust.git] / src / test / ui / union / union-with-drop-fields.mirunsafeck.stderr
1 error[E0740]: unions cannot contain fields that may need dropping
2   --> $DIR/union-with-drop-fields.rs:11:5
3    |
4 LL |     a: String,
5    |     ^^^^^^^^^
6    |
7    = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
8 help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
9    |
10 LL |     a: std::mem::ManuallyDrop<String>,
11    |        +++++++++++++++++++++++      +
12
13 error[E0740]: unions cannot contain fields that may need dropping
14   --> $DIR/union-with-drop-fields.rs:19:5
15    |
16 LL |     a: S,
17    |     ^^^^
18    |
19    = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
20 help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
21    |
22 LL |     a: std::mem::ManuallyDrop<S>,
23    |        +++++++++++++++++++++++ +
24
25 error[E0740]: unions cannot contain fields that may need dropping
26   --> $DIR/union-with-drop-fields.rs:24:5
27    |
28 LL |     a: T,
29    |     ^^^^
30    |
31    = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
32 help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
33    |
34 LL |     a: std::mem::ManuallyDrop<T>,
35    |        +++++++++++++++++++++++ +
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0740`.