Skip to content

Commit 74f5c61

Browse files
committed
Change how type-sizes works slightly: we want to ensure that [i16; 0] introduces padding
1 parent 5adf694 commit 74f5c61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/run-pass/type-sizes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ enum e2 {
2626
a(u32), b
2727
}
2828

29+
#[repr(u8)]
2930
enum e3 {
3031
a([u16; 0], u8), b
3132
}
@@ -52,5 +53,5 @@ pub fn main() {
5253

5354
assert_eq!(size_of::<e1>(), 8 as usize);
5455
assert_eq!(size_of::<e2>(), 8 as usize);
55-
assert_eq!(size_of::<e3>(), 2 as usize);
56+
assert_eq!(size_of::<e3>(), 4 as usize);
5657
}

0 commit comments

Comments
 (0)