01
doc.rust-lang.orgUNREAD
repr(Rust) - The Rustonomicon
This Rustonomicon chapter explains the default repr(Rust) type layout rules: alignment, size, and compiler-inserted padding. It argues that field ordering is deliberately unspecified because generic monomorphizations may need different orderings to avoid wasted space, and enums can use tricks like the null pointer optimization to eliminate tags. The tradeoff is compiler layout flexibility versus the inability to assume a stable memory layout.