Skip to content
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

support deriving Zeroable for fieldless enums #233

Merged
merged 2 commits into from
May 28, 2024

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Apr 4, 2024

This PR makes it possible to derive Zeroable on enums under the following conditions:

  • The enum has an integer repr set using #[repr(Int)].
  • The enum is fieldless (this restriction could be relaxed in the future).
  • There is a variant whose discriminant is 0.

@Lokathor Lokathor requested a review from fu5ha April 10, 2024 01:03
@Lokathor Lokathor added semver-minor semver minor change semver-derive We need to update the main crate's use of the derive crate labels May 28, 2024
@Lokathor Lokathor merged commit a630404 into Lokathor:main May 28, 2024
14 checks passed
zachs18 pushed a commit to zachs18/bytemuck that referenced this pull request Jun 6, 2024
* support deriving Zeroable for fieldless enums

* add test for deriving Zeroable on enum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-derive We need to update the main crate's use of the derive crate semver-minor semver minor change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants