Do #[repr(Rust)] unions have internal padding? · Issue #354 · rust-lang/unsafe-code-guidelines (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Forked from #156. The question is specifically whether a union type has non-tail padding when every variant has padding at a particular byte, meaning that the padding could be clobbered. @RalfJung says no, because he would like unions to simply be [byte; N]
. Nobody has made a case for any other answer, as far as I'm aware. But making a separate issue since it's a separate question about the #[repr(Rust)]
ABI and what we want to guarantee.