Change how type-sizes works slightly: we want to ensure that [i16; 0] introduces padding

This commit is contained in:
Austin Hicks 2016-11-22 15:18:28 -05:00
parent 5adf6943a7
commit 74f5c61d28

View File

@ -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::<e1>(), 8 as usize);
assert_eq!(size_of::<e2>(), 8 as usize);
assert_eq!(size_of::<e3>(), 2 as usize);
assert_eq!(size_of::<e3>(), 4 as usize);
}