The compiler should error when trying to transmute pointer values with incompatible alignment #95479
Labels
A-type-system
Area: Type system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: the compiler complains about the alignment of the array not being good enough for the struct Foo
Instead, this happened: the compiler did not complain
Meta
rustc --version --verbose
:This issue was noticed by the creator of Zig in this blog post: https://andrewkelley.me/post/unsafe-zig-safer-than-unsafe-rust.html.
The text was updated successfully, but these errors were encountered: