Why do #[repr(C)] structs require Unaligned for their fields when deriving IntoBytes?
#2900
Unanswered
TheTollingBell
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
This requirement is often a limitation of |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
According to the docs for the
IntoBytesderive:I don't really understand why there is a requirement that
repr(C)must beUnaligned, since the alignment of[u8; _]is1.The types being derived on are generated with
bindgenfrom the Linux kernel headers ofFUSE. Here is an excerpt of a struct failing to compile:Error:
Beta Was this translation helpful? Give feedback.
All reactions