11error[E0740]: unions cannot contain fields that may need dropping
2- --> $DIR/field_checks.rs:25 :5
2+ --> $DIR/field_checks.rs:24 :5
33 |
44LL | a: String,
55 | ^^^^^^^^^
@@ -11,7 +11,7 @@ LL | a: std::mem::ManuallyDrop<String>,
1111 | +++++++++++++++++++++++ +
1212
1313error[E0740]: unions cannot contain fields that may need dropping
14- --> $DIR/field_checks.rs:29 :5
14+ --> $DIR/field_checks.rs:28 :5
1515 |
1616LL | a: std::cell::RefCell<i32>,
1717 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | a: std::mem::ManuallyDrop<std::cell::RefCell<i32>>,
2323 | +++++++++++++++++++++++ +
2424
2525error[E0740]: unions cannot contain fields that may need dropping
26- --> $DIR/field_checks.rs:33 :5
26+ --> $DIR/field_checks.rs:32 :5
2727 |
2828LL | a: T,
2929 | ^^^^
@@ -35,7 +35,7 @@ LL | a: std::mem::ManuallyDrop<T>,
3535 | +++++++++++++++++++++++ +
3636
3737error[E0740]: unions cannot contain fields that may need dropping
38- --> $DIR/field_checks.rs:45 :5
38+ --> $DIR/field_checks.rs:44 :5
3939 |
4040LL | nest: U5,
4141 | ^^^^^^^^
@@ -46,6 +46,18 @@ help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>
4646LL | nest: std::mem::ManuallyDrop<U5>,
4747 | +++++++++++++++++++++++ +
4848
49- error: aborting due to 4 previous errors
49+ error[E0740]: unions cannot contain fields that may need dropping
50+ --> $DIR/field_checks.rs:48:5
51+ |
52+ LL | nest: [U5; 0],
53+ | ^^^^^^^^^^^^^
54+ |
55+ = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
56+ help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
57+ |
58+ LL | nest: std::mem::ManuallyDrop<[U5; 0]>,
59+ | +++++++++++++++++++++++ +
60+
61+ error: aborting due to 5 previous errors
5062
5163For more information about this error, try `rustc --explain E0740`.
0 commit comments