You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would have expected the alignment of B to be 1 since it is repr(packed). https://doc.rust-lang.org/nomicon/other-reprs.html#reprpacked says "repr(packed) forces Rust to strip any padding, and only align the type to a byte", and doesn't mention an exception for DSTs.
The text was updated successfully, but these errors were encountered:
Example code (playground link)
Running this outside of Miri gives the output I would expect; values of
A
andB
both have an alignment of 1:But when running under Miri, I get this instead:
I would have expected the alignment of
B
to be 1 since it isrepr(packed)
. https://doc.rust-lang.org/nomicon/other-reprs.html#reprpacked says "repr(packed) forces Rust to strip any padding, and only align the type to a byte", and doesn't mention an exception for DSTs.The text was updated successfully, but these errors were encountered: