Skip to content

Commit

Permalink
Change how type-sizes works slightly: we want to ensure that [i16; 0]…
Browse files Browse the repository at this point in the history
… introduces padding
  • Loading branch information
ahicks92 committed Dec 14, 2016
1 parent 5adf694 commit 74f5c61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/run-pass/type-sizes.rs
Expand Up @@ -26,6 +26,7 @@ enum e2 {
a(u32), b
}

#[repr(u8)]
enum e3 {
a([u16; 0], u8), b
}
Expand All @@ -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);
}

0 comments on commit 74f5c61

Please sign in to comment.