1 use std::mem::ManuallyDrop;
7 union U2<T: Copy> { // OK
16 a: (ManuallyDrop<T>, i32),
20 a: [ManuallyDrop<T>; 2],
24 a: String, //~ ERROR unions cannot contain fields that may need dropping
27 union U32 { // field that does not drop but is not `Copy`, either
28 a: std::cell::RefCell<i32>, //~ ERROR unions cannot contain fields that may need dropping
32 a: T, //~ ERROR unions cannot contain fields that may need dropping
35 union U5 { // Having a drop impl is OK
43 union U5Nested { // a nested union that drops is NOT OK
44 nest: U5, //~ ERROR unions cannot contain fields that may need dropping
47 union U5Nested2 { // for now we don't special-case empty arrays
48 nest: [U5; 0], //~ ERROR unions cannot contain fields that may need dropping
57 f: (&'static mut i32, ManuallyDrop<T>, i32),
61 f1: [(&'static mut i32, i32); 8],
62 f2: [ManuallyDrop<T>; 2],