]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/associated-type-bounds/inside-adt.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / associated-type-bounds / inside-adt.rs
index 5af057387509de774abfd4f2291b298a7b6bc4da..f26037f07076646be416144672c6cbe04dc154a2 100644 (file)
@@ -1,5 +1,6 @@
 #![feature(associated_type_bounds)]
-#![feature(untagged_unions)]
+
+use std::mem::ManuallyDrop;
 
 struct S1 { f: dyn Iterator<Item: Copy> }
 //~^ ERROR associated type bounds are not allowed within structs, enums, or unions
@@ -17,12 +18,12 @@ enum E3 { V(dyn Iterator<Item: 'static>) }
 //~^ ERROR associated type bounds are not allowed within structs, enums, or unions
 //~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)`
 
-union U1 { f: dyn Iterator<Item: Copy> }
+union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
 //~^ ERROR associated type bounds are not allowed within structs, enums, or unions
 //~| ERROR the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)`
-union U2 { f: Box<dyn Iterator<Item: Copy>> }
+union U2 { f: ManuallyDrop<Box<dyn Iterator<Item: Copy>>> }
 //~^ ERROR associated type bounds are not allowed within structs, enums, or unions
-union U3 { f: dyn Iterator<Item: 'static> }
+union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
 //~^ ERROR associated type bounds are not allowed within structs, enums, or unions
 //~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)`