From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/structs-enums/enum-layout-optimization.rs | 50 ---------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/test/ui/structs-enums/enum-layout-optimization.rs (limited to 'src/test/ui/structs-enums/enum-layout-optimization.rs') diff --git a/src/test/ui/structs-enums/enum-layout-optimization.rs b/src/test/ui/structs-enums/enum-layout-optimization.rs deleted file mode 100644 index 05d297906..000000000 --- a/src/test/ui/structs-enums/enum-layout-optimization.rs +++ /dev/null @@ -1,50 +0,0 @@ -// run-pass -// Test that we will do various size optimizations to enum layout, but -// *not* if `#[repr(u8)]` or `#[repr(C)]` is passed. See also #40029. - -#![allow(dead_code)] - -use std::mem; - -enum Nullable { - Alive(T), - Dropped, -} - -#[repr(u8)] -enum NullableU8 { - Alive(T), - Dropped, -} - -#[repr(C)] -enum NullableC { - Alive(T), - Dropped, -} - -struct StructNewtype(T); - -#[repr(C)] -struct StructNewtypeC(T); - -enum EnumNewtype { Variant(T) } - -#[repr(u8)] -enum EnumNewtypeU8 { Variant(T) } - -#[repr(C)] -enum EnumNewtypeC { Variant(T) } - -fn main() { - assert!(mem::size_of::>() == mem::size_of::>>()); - assert!(mem::size_of::>() < mem::size_of::>>()); - assert!(mem::size_of::>() < mem::size_of::>>()); - - assert!(mem::size_of::() == mem::size_of::>()); - assert!(mem::size_of::() == mem::size_of::>()); - - assert!(mem::size_of::() == mem::size_of::>()); - assert!(mem::size_of::() < mem::size_of::>()); - assert!(mem::size_of::() < mem::size_of::>()); -} -- cgit v1.2.3