From 74f5c61d288fdd925968aca49d1fd82f6e226ff8 Mon Sep 17 00:00:00 2001 From: Austin Hicks Date: Tue, 22 Nov 2016 15:18:28 -0500 Subject: [PATCH] Change how type-sizes works slightly: we want to ensure that [i16; 0] introduces padding --- src/test/run-pass/type-sizes.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/run-pass/type-sizes.rs b/src/test/run-pass/type-sizes.rs index 8c58ec3e526..359f825bb63 100644 --- a/src/test/run-pass/type-sizes.rs +++ b/src/test/run-pass/type-sizes.rs @@ -26,6 +26,7 @@ enum e2 { a(u32), b } +#[repr(u8)] enum e3 { a([u16; 0], u8), b } @@ -52,5 +53,5 @@ pub fn main() { assert_eq!(size_of::(), 8 as usize); assert_eq!(size_of::(), 8 as usize); - assert_eq!(size_of::(), 2 as usize); + assert_eq!(size_of::(), 4 as usize); }