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

Deny derive attributes on enum variants #170

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

wackbyte
Copy link
Contributor

@wackbyte wackbyte commented Jan 12, 2024

Adds a check to produce an error when an enum variant with an #[arbitrary] derive attribute is encountered.
I did not implement the ability to apply the attribute transparently to single-field variants.

Preview:

error: invalid `arbitrary` attribute. it is unsupported on enum variants. try applying it to a field of the variant instead
 --> src\lib.rs:1675:5
  |
7 |     #[arbitrary(default)]
  |     ^^^^^^^^^^^^^^^^^^^^^

Closes #149 and #150.

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fitzgen fitzgen merged commit dc92ff8 into rust-fuzz:main Jan 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arbitrary derive doesn't play nicely with cfg_attr
2 participants