I notice that the new InlineArray is based on a [u8; 8] that then gets converted to its different kinds. Its base representation should be a NonZero, since it appears that all valid bit patterns of it are intended to be nonzero. The compiler can then optimize things like Option<NonZeroU64> to be only u64 sized and greatly improve the padding of structs that use it.
I notice that the new
InlineArray
is based on a[u8; 8]
that then gets converted to its different kinds. Its base representation should be aNonZero
, since it appears that all valid bit patterns of it are intended to be nonzero. The compiler can then optimize things likeOption<NonZeroU64>
to be onlyu64
sized and greatly improve the padding of structs that use it.