-
Notifications
You must be signed in to change notification settings - Fork 234
Remove RNG traits in favor of rand_core. #270
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
Conversation
The [rand_core](https://crates.io/crates/rand_core) crate already implements relevant traits for random number generation. A HAL which provides access to a RNG peripheral should implement these traits instead and a driver should rely on these.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @therealprof (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
In the discussion, it was mentioned that some pointers and documentation on this change are required. I'm not sure on where to do this. The release notes seem to be the best place as it is hard to document stuff that is not existing anymore. |
It's probably wiser to first mark the traits as deprecated as in #271 before removing them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks! I would go ahead with the removal without deprecation step.
Any objections @rust-embedded/hal?
Co-authored-by: Diego Barrios Romero <[email protected]>
i'm okay with it, maybe it'd be nice to have a note in the docs somewhere to go looking at |
Regarding the documentation: One could re-add the modules but without the traits and only with a note to |
I would add the documentation note but not the |
Sorry, but I didn't fully understand where you think the note should go. |
I think I would put it somewhere in |
As proposed in #128 here is a PR that completely removes the RNG traits from the embedded-hal.
This closes #128.
Reasoning:
The rand_core crate already implements relevant traits for random number generation. A HAL which provides access to an RNG peripheral should implement these traits instead (Example: stm32f4xx-hal) and a driver should rely on these.
Impact:
This is a breaking change. Should be done before a 1.0.0 release.
Alternatives