aligned
aligned copied to clipboard
Representation guarantee?
trafficstars
Is there a guarantee that Aligned<A, T> has the same memory representation as T, and is thus sound to transmute to T?
My understanding is:
- The alignment struct is
repr(C) - ZSTs are ignored when a struct is
repr(C) - Alignment is ensured via a ZST array.
- The layout should therefore be the same as if it were
Titself
I am not the original author of the library, so this might not be correct. In practice, however, this is how it works with current versions of the Rust compiler.