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
internal: move alignment check to make_field_check
Instead of having the reference creation serving dual-purpose as both for
let bindings and alignment check, detangle them so that the alignment check
is done explicitly in `make_field_check`. This is more robust again
refactors that may change the way let bindings are created.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
= note: this struct is 1-byte aligned, but the type of this field may require higher alignment
8
8
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
9
9
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10
10
= note: this error originates in the macro `init` (in Nightly builds, run with -Z macro-backtrace for more info)
11
+
12
+
error[E0793]: reference to field of packed struct is unaligned
= note: this struct is 1-byte aligned, but the type of this field may require higher alignment
23
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
24
+
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
25
+
= note: this error originates in the macro `init` (in Nightly builds, run with -Z macro-backtrace for more info)
0 commit comments