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

Derive arbitrary if fuzzing #20

Closed

Conversation

lrubasze
Copy link
Contributor

@lrubasze lrubasze commented May 8, 2023

Introduced "fuzzing" feature to enable struct-aware fuzzing of the types introduced by bnum crate.

Unfortunately arbitrary works only for std at the moment.

More details on arbitrary:
https://github.com/rust-fuzz/arbitrary
https://docs.rs/arbitrary/latest/arbitrary/

@lrubasze
Copy link
Contributor Author

lrubasze commented May 8, 2023

Hi @isaacholt100,
I thought that maybe you could find "fuzzing" feature useful.
Hope my PR covers it properly. If not then I am open to amend it according to your expectations.

And CI failed - maybe you could advise what could be wrong with it?

@isaacholt100
Copy link
Owner

Hi @lrubasze, thanks for writing this PR. I'm in the middle of exam season at the moment so unfortunately I won't have time to look at this for a bit, but once my exams are over I'll make sure I have a proper look. Looks like CI is failing because arithmetic traits such as Sub have const implementations but aren't marked as const. This is strange as I'm fairly sure these traits used to be const, so this is possibly a breaking change in the nightly compiler? I'll investigate further when I have time though.

@lrubasze
Copy link
Contributor Author

lrubasze commented May 8, 2023

Hi @isaacholt100, thanks for prompt reply. Waiting for your feedback then 😄 Good luck during your exams 🤞

@isaacholt100
Copy link
Owner

Hi @lrubasze, exams are over now so I'll hopefully be able to merge this in a day or two. It seems as though the Rust team are redesigning const traits, so it looks like as of v1.71.0-nightly, a lot of standard library traits such as From, Add, etc. can't be const implemented, which is why the check is failing at the moment. What I'll do is write const method equivalents of these, to be implemented on the integer types themselves rather than the traits, then remove the const impls of the traits. I'll then merge this PR with my changes and publish a new version based off these updates.

@isaacholt100
Copy link
Owner

Have merged these changes into the arbitrary branch which I will soon publish as a new version. Apologies, as the CI was failing it made it a bit awkward to merge this PR and as there was a small number of changes I decided it would be easier to just transfer these across to the most up to date version. The commit message I made for these changes mentions this issue to give you credit, hope that is ok!

@isaacholt100
Copy link
Owner

Version 0.7.0 published!

@lrubasze
Copy link
Contributor Author

Hi @isaacholt100, sorry for late reply - was on holiday. Many thanks proceeding with this.
I have noticed you changed the feature name from fuzzing to arbitrary.
Usually the flag that enables some features related to fuzzing is called fuzzing, I saw it in many libraries.
But that is not a problem at all, arbitrary is just fine 😄

@isaacholt100
Copy link
Owner

Hi @lrubasze, no worries, hope you had a good holiday! I chose the feature name to arbitrary as I've done the same for other features which just activate an external crate, but I wasn't aware of this convention, so thanks for letting me know!

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.

2 participants