We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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>()); }
8 4 8
i.e. when the compiler sees multiple repr arguments, it takes the first one and ignores the rest.
repr
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:
#[repr(C, u32)] -> #[repr(u32)]
#[repr(C, u32)]
#[repr(u32)]
a3f1664
See rust-lang/rust#34622
Auto merge of #34623 - lfairy:repr-conflict, r=Aatch
603d9cc
Warn about multiple conflicting #[repr] hints Closes #34622
fix: warning E0566 (#1)
82f9838
Using multiple arguments to #[repr] does not work as we expected. See: rust-lang/rust#34622
No branches or pull requests
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: