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/structs-enums/align-enum.rs | 54 --------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/test/ui/structs-enums/align-enum.rs (limited to 'src/test/ui/structs-enums/align-enum.rs') diff --git a/src/test/ui/structs-enums/align-enum.rs b/src/test/ui/structs-enums/align-enum.rs deleted file mode 100644 index fa872caa3..000000000 --- a/src/test/ui/structs-enums/align-enum.rs +++ /dev/null @@ -1,54 +0,0 @@ -// run-pass -#![allow(dead_code)] - -use std::mem; - -// Raising alignment -#[repr(align(16))] -enum Align16 { - Foo { foo: u32 }, - Bar { bar: u32 }, -} - -// Raise alignment by maximum -#[repr(align(1), align(16))] -#[repr(align(32))] -#[repr(align(4))] -enum Align32 { - Foo, - Bar, -} - -// Not reducing alignment -#[repr(align(4))] -enum AlsoAlign16 { - Foo { limb_with_align16: Align16 }, - Bar, -} - -// No niche for discriminant when used as limb -#[repr(align(16))] -struct NoNiche16(u64, u64); - -// Discriminant will require extra space, but enum needs to stay compatible -// with alignment 16 -#[repr(align(1))] -enum AnotherAlign16 { - Foo { limb_with_noniche16: NoNiche16 }, - Bar, - Baz, -} - -fn main() { - assert_eq!(mem::align_of::(), 16); - assert_eq!(mem::size_of::(), 16); - - assert_eq!(mem::align_of::(), 32); - assert_eq!(mem::size_of::(), 32); - - assert_eq!(mem::align_of::(), 16); - assert_eq!(mem::size_of::(), 16); - - assert_eq!(mem::align_of::(), 16); - assert_eq!(mem::size_of::(), 32); -} -- cgit v1.2.3