]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/field_checks.stderr
Rollup merge of #102685 - nbdd0121:unwind, r=m-ou-se
[rust.git] / src / test / ui / union / field_checks.stderr
1 error[E0740]: unions cannot contain fields that may need dropping
2   --> $DIR/field_checks.rs:24: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/field_checks.rs:28:5
15    |
16 LL |     a: std::cell::RefCell<i32>,
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<std::cell::RefCell<i32>>,
23    |        +++++++++++++++++++++++                       +
24
25 error[E0740]: unions cannot contain fields that may need dropping
26   --> $DIR/field_checks.rs:32: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[E0740]: unions cannot contain fields that may need dropping
38   --> $DIR/field_checks.rs:44:5
39    |
40 LL |     nest: U5,
41    |     ^^^^^^^^
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
45    |
46 LL |     nest: std::mem::ManuallyDrop<U5>,
47    |           +++++++++++++++++++++++  +
48
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
62
63 For more information about this error, try `rustc --explain E0740`.