You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::mem;#[repr(u64)]enumBookHorses{TwilightSparkle}#[repr(C,u64)]enumPurpleHorses{TwilightSparkle}#[repr(u64,C)]enumPrincessHorses{TwilightSparkle}fnmain(){println!("{}", mem::size_of::<BookHorses>());println!("{}", mem::size_of::<PurpleHorses>());println!("{}", mem::size_of::<PrincessHorses>());}
Output
8
4
8
i.e. when the compiler sees multiple repr arguments, it takes the first one and ignores the rest.
Expected behavior
Either all enums should have the same size, or the latter enums should not compile.
The text was updated successfully, but these errors were encountered:
Code
Output
i.e. when the compiler sees multiple
repr
arguments, it takes the first one and ignores the rest.Expected behavior
Either all enums should have the same size, or the latter enums should not compile.
The text was updated successfully, but these errors were encountered: