|
1 |
| -error[E0740]: unions cannot contain fields that may need dropping |
| 1 | +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union |
2 | 2 | --> $DIR/field_checks.rs:24:5
|
3 | 3 | |
|
4 | 4 | LL | a: String,
|
5 | 5 | | ^^^^^^^^^
|
6 | 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 |
| 7 | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` |
| 8 | +help: wrap the field type in `ManuallyDrop<...>` |
9 | 9 | |
|
10 | 10 | LL | a: std::mem::ManuallyDrop<String>,
|
11 | 11 | | +++++++++++++++++++++++ +
|
12 | 12 |
|
13 |
| -error[E0740]: unions cannot contain fields that may need dropping |
| 13 | +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union |
14 | 14 | --> $DIR/field_checks.rs:28:5
|
15 | 15 | |
|
16 | 16 | LL | a: std::cell::RefCell<i32>,
|
17 | 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
18 | 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 |
| 19 | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` |
| 20 | +help: wrap the field type in `ManuallyDrop<...>` |
21 | 21 | |
|
22 | 22 | LL | a: std::mem::ManuallyDrop<std::cell::RefCell<i32>>,
|
23 | 23 | | +++++++++++++++++++++++ +
|
24 | 24 |
|
25 |
| -error[E0740]: unions cannot contain fields that may need dropping |
| 25 | +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union |
26 | 26 | --> $DIR/field_checks.rs:32:5
|
27 | 27 | |
|
28 | 28 | LL | a: T,
|
29 | 29 | | ^^^^
|
30 | 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 |
| 31 | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` |
| 32 | +help: wrap the field type in `ManuallyDrop<...>` |
33 | 33 | |
|
34 | 34 | LL | a: std::mem::ManuallyDrop<T>,
|
35 | 35 | | +++++++++++++++++++++++ +
|
36 | 36 |
|
37 |
| -error[E0740]: unions cannot contain fields that may need dropping |
| 37 | +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union |
38 | 38 | --> $DIR/field_checks.rs:44:5
|
39 | 39 | |
|
40 | 40 | LL | nest: U5,
|
41 | 41 | | ^^^^^^^^
|
42 | 42 | |
|
43 |
| - = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type |
44 |
| -help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped |
| 43 | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` |
| 44 | +help: wrap the field type in `ManuallyDrop<...>` |
45 | 45 | |
|
46 | 46 | LL | nest: std::mem::ManuallyDrop<U5>,
|
47 | 47 | | +++++++++++++++++++++++ +
|
48 | 48 |
|
49 |
| -error[E0740]: unions cannot contain fields that may need dropping |
| 49 | +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union |
50 | 50 | --> $DIR/field_checks.rs:48:5
|
51 | 51 | |
|
52 | 52 | LL | nest: [U5; 0],
|
53 | 53 | | ^^^^^^^^^^^^^
|
54 | 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 |
| 55 | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` |
| 56 | +help: wrap the field type in `ManuallyDrop<...>` |
57 | 57 | |
|
58 | 58 | LL | nest: std::mem::ManuallyDrop<[U5; 0]>,
|
59 | 59 | | +++++++++++++++++++++++ +
|
|
0 commit comments