Change how type-sizes works slightly: we want to ensure that [i16; 0] introduces padding
This commit is contained in:
parent
5adf6943a7
commit
74f5c61d28
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue