From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/union/field_checks.rs | 65 --------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 src/test/ui/union/field_checks.rs (limited to 'src/test/ui/union/field_checks.rs') diff --git a/src/test/ui/union/field_checks.rs b/src/test/ui/union/field_checks.rs deleted file mode 100644 index d5d1e44ac..000000000 --- a/src/test/ui/union/field_checks.rs +++ /dev/null @@ -1,65 +0,0 @@ -use std::mem::ManuallyDrop; - -union U1 { // OK - a: u8, -} - -union U2 { // OK - a: T, -} - -union U22 { // OK - a: ManuallyDrop, -} - -union U23 { // OK - a: (ManuallyDrop, i32), -} - -union U24 { // OK - a: [ManuallyDrop; 2], -} - -union U3 { - a: String, //~ ERROR unions cannot contain fields that may need dropping -} - -union U32 { // field that does not drop but is not `Copy`, either - a: std::cell::RefCell, //~ ERROR unions cannot contain fields that may need dropping -} - -union U4 { - a: T, //~ ERROR unions cannot contain fields that may need dropping -} - -union U5 { // Having a drop impl is OK - a: u8, -} - -impl Drop for U5 { - fn drop(&mut self) {} -} - -union U5Nested { // a nested union that drops is NOT OK - nest: U5, //~ ERROR unions cannot contain fields that may need dropping -} - -union U5Nested2 { // for now we don't special-case empty arrays - nest: [U5; 0], //~ ERROR unions cannot contain fields that may need dropping -} - -union U6 { // OK - s: &'static i32, - m: &'static mut i32, -} - -union U7 { // OK - f: (&'static mut i32, ManuallyDrop, i32), -} - -union U8 { // OK - f1: [(&'static mut i32, i32); 8], - f2: [ManuallyDrop; 2], -} - -fn main() {} -- cgit v1.2.3