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
A common use of unsafe code is to access or modify the bytes of libc types (e.g. by transmuting them; here's an example). Many libc types could implement the zerocopy traits (FromBytes, AsBytes, and Unaligned) by using a custom derive, so this would just be a matter of adding #[cfg_attr(feature = "zerocopy", derive(FromBytes, AsBytes, Unaligned))] to the types which support it. This would allow all of those uses to be safe.
If this is something that the maintainers would be open to, I'd be happy to put up a PR.
The text was updated successfully, but these errors were encountered:
A common use of
unsafe
code is to access or modify the bytes of libc types (e.g. by transmuting them; here's an example). Many libc types could implement the zerocopy traits (FromBytes, AsBytes, and Unaligned) by using a custom derive, so this would just be a matter of adding#[cfg_attr(feature = "zerocopy", derive(FromBytes, AsBytes, Unaligned))]
to the types which support it. This would allow all of those uses to be safe.If this is something that the maintainers would be open to, I'd be happy to put up a PR.
The text was updated successfully, but these errors were encountered: