rust-random / rand

A Rust library for random number generation.
https://crates.io/crates/rand
Other
1.67k stars 431 forks source link

Allow using std feature without bringing in getrandom and rand_chacha dependencies #1339

Closed SUPERCILEX closed 1 year ago

SUPERCILEX commented 1 year ago

I'd like to be able to use rand with the std feature so I get access to RngReadAdapter, but I don't want to be pulling in getrandom and rand_chacha. There should be a feature split that allows using the stdlib without extra deps.

dhardy commented 1 year ago

Sounds reasonable. It's a breaking change but the next release will be v0.9.0 (breaking) anyway.

This requires "rand_chacha?/std" syntax (see here) which is only available from Rust 1.60; the current MSRV is 1.56. I think bumping this is probably reasonable; 1.60 is from April 2022 and even Debian stable includes 1.63 by now.

The more controversial part is dropping getrandom from the std feature. I guess this is fine given that the current default feature is essentially just the current std anyway.

I'll give the other maintainers a chance to comment, but from my side this looks like a good change.

dhardy commented 1 year ago

We already bumped the MSRV to 1.60. @SUPERCILEX could you make a PR?

SUPERCILEX commented 1 year ago

Done: https://github.com/rust-random/rand/pull/1354