Re:When zero cost abstractions aren't zero cost
by the8472 on Tuesday August 10, 2021 @03:48PM
(#28133362)
Knowing that they usually are at the end doesn't help since you still need to write a general runtime check that expresses "are all the bits for this type zero or uninit". Afaik currently there is no way to do this without causing UB. This would need some new intrinsic.
Especially in a case like in the article, where the type is very small (one byte), and the obstacle is that the author is using a newtype.