-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax requirements for deriving FromZeroes
on enums
#30
Comments
joshlf
added a commit
that referenced
this issue
Nov 10, 2022
Closes #30 TODO: - Support deriving on enums - Doc comment on `FromZeroes` - trybuild tests for zerocopy-derive
joshlf
added a commit
that referenced
this issue
Nov 10, 2022
Closes #30 TODO: - Support deriving on enums - Doc comment on `FromZeroes` - trybuild tests for zerocopy-derive
joshlf
added a commit
that referenced
this issue
Nov 10, 2022
Closes #30 TODO: - Support deriving on enums - Doc comment on `FromZeroes` - trybuild tests for zerocopy-derive
joshlf
added a commit
that referenced
this issue
Nov 11, 2022
Closes #30 TODO: Doc comment on `FromZeroes`
joshlf
added a commit
that referenced
this issue
Nov 11, 2022
Closes #30 TODO: Doc comment on `FromZeroes`
Reopening so that this issue can track deriving |
joshlf
changed the title
Add
Relax requirements for deriving Nov 15, 2022
FromZeroes
traitFromZeroes
on enums
@djkoloski if you'd like, I can assign this to you (you just need to comment on this issue first before GitHub will let me do that). |
Sure! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue used to track
FromZeroes
, which has now been merged. However, support for#[derive(FromZeroes)]
is incomplete - the rules implemented when deriving on an enum are equivalent to the rules for derivingFromBytes
on an enum. Those rules are unnecessarily restrictive.Now, this issue tracks:
FromZeroes
Old text
Add an
unsafe
marker trait calledFromZeroes
(or similar) which indicates that a type can be safely constructed from all 0 bytes. Add a custom derive tozerocopy-derive
for this trait.I would expect the API to look something like this:
The text was updated successfully, but these errors were encountered: