Is `align_of` guaranteed to be non-zero?

⚓ Rust    📅 2026-06-05    👤 surdeus    👁️ 4      

surdeus

Does anyone know where I might find documentation that core::mem::align_of is guaranteed (or not guaranteed) to never return 0? If it is (currently) guaranteed, is there a particular reason the devs decided to go with usize instead of NonZeroUsize?

5 posts - 4 participants

Read full topic

🏷️ Rust_feed