Skip to content

Upgrade to rand v0.10 and/or v0.9, and split rand_core#338

Draft
cuviper wants to merge 3 commits intorust-num:masterfrom
cuviper:rand-0.10
Draft

Upgrade to rand v0.10 and/or v0.9, and split rand_core#338
cuviper wants to merge 3 commits intorust-num:masterfrom
cuviper:rand-0.10

Conversation

@cuviper
Copy link
Member

@cuviper cuviper commented Feb 4, 2026

This now implements RandBigInt with only rand_core::Rng to allow a
slimmer dependency tree. The other distribution-related types still
require rand for its traits though.

Our gen_big* methods are also renamed to random_big* to match the
change that rand had made in 0.9. The old names are deprecated, but
still present, simply forwarding to the new names.

Hat tip to @bionicles and @divergentdave as well for their rand v0.9 PRs (#317, #322),
and I apologize for never getting around to those. Let's reset that debt by getting
0.10 much sooner!

The crate features are now explicitly versioned, allowing either 0.9 or 0.10, or both.
So we now have rand_0_9, rand_core_0_9, rand_0_10, and rand_core_0_10.

RandBigInt is also renamed and forked to BigRng09 and BigRng010, so the name
is versioned and better implies that it is an extension of Rng. The other distribution
structs are simply shared with trait implementations for either/both versions.

This now implements `RandBigInt` with only `rand_core::Rng` to allow a
slimmer dependency tree. The other distribution-related types still
require `rand` for its traits though.

Our `gen_big*` methods are also renamed to `random_big*` to match the
change that `rand` had made in 0.9. The old names are deprecated, but
still present, simply forwarding to the new names.
Cargo.toml Outdated
[dependencies.rand]
optional = true
version = "0.8"
version = "0.10.0-rc.9"
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll wait in draft until 0.10.0 is released.

@bionicles
Copy link

0.10 is out! looks good to me, i copied your homework to debug my fork

rand 0.10 update guide if this is a minor release i'd hate to see a major one

@xtqqczze
Copy link

@cuviper Would it be possible to first cut a new release after updating to rand 0.9 (#322)? It would be great to have a release available with a MSRV of 1.63 before it gets bumped to 1.85.

This was referenced Feb 22, 2026
@cuviper
Copy link
Member Author

cuviper commented Feb 23, 2026

@xtqqczze Just for MSRV, can't you keep using the current rand support? As I see it, 0.9 would only be useful if you also need interoperability with other crates using the same rand.

However, I'm also considering that maybe we should support both -- e.g. use rand09 and rand010 features and keep our public API in modules by the same name, without re-exporting at the root.

@xtqqczze
Copy link

@xtqqczze Just for MSRV, can't you keep using the current rand support? As I see it, 0.9 would only be useful if you also need interoperability with other crates using the same rand.

Yes, releasing with rand 0.9 would help prevent having multiple rand versions in the dependency tree, bloating the size of targets, see https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

@cuviper cuviper changed the title Upgrade to rand v0.10 and split rand_core v0.10 Upgrade to rand v0.10 and/or v0.9, and split rand_core Feb 25, 2026
@cuviper
Copy link
Member Author

cuviper commented Feb 25, 2026

However, I'm also considering that maybe we should support both

This wasn't too hard to manage -- please take a look!

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.

3 participants