Closed
Description
Code
use std::mem;
#[repr(u64)]
enum BookHorses { TwilightSparkle }
#[repr(C, u64)]
enum PurpleHorses { TwilightSparkle }
#[repr(u64, C)]
enum PrincessHorses { TwilightSparkle }
fn main() {
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.