]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-untagged_unions.stderr
Rollup merge of #93850 - asquared31415:extern-static-size-ice, r=jackh726
[rust.git] / src / test / ui / feature-gates / feature-gate-untagged_unions.stderr
1 error[E0658]: unions with non-`Copy` fields other than `ManuallyDrop<T>` are unstable
2   --> $DIR/feature-gate-untagged_unions.rs:20:5
3    |
4 LL |     a: std::cell::RefCell<i32>,
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
8    = help: add `#![feature(untagged_unions)]` to the crate attributes to enable
9
10 error[E0740]: unions cannot contain fields that may need dropping
11   --> $DIR/feature-gate-untagged_unions.rs:16:5
12    |
13 LL |     a: String,
14    |     ^^^^^^^^^
15    |
16    = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
17 help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
18    |
19 LL |     a: std::mem::ManuallyDrop<String>,
20    |        +++++++++++++++++++++++      +
21
22 error[E0740]: unions cannot contain fields that may need dropping
23   --> $DIR/feature-gate-untagged_unions.rs:24:5
24    |
25 LL |     a: T,
26    |     ^^^^
27    |
28    = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
29 help: when the type does not implement `Copy`, wrap it inside a `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 Some errors have detailed explanations: E0658, E0740.
37 For more information about an error, try `rustc --explain E0658`.