Skip to content

Conversation

@newpavlov
Copy link
Member

@newpavlov newpavlov commented Jan 20, 2026

Drop the "core" part to make the names shorter, less confusing, and more consistent with the crypto traits.

This change implies renaming of rand::Rng to rand::RngExt.

@newpavlov newpavlov requested a review from josephlr January 20, 2026 22:35
Co-authored-by: Tony Arcieri <bascule@gmail.com>
@tarcieri
Copy link
Contributor

tarcieri commented Jan 20, 2026

As someone who primarily uses rand_core I like it, but I may be biased, though I suspect there are a lot of people whose usage of rand is limited to rand::rng() and the RngCore trait.

@newpavlov newpavlov requested a review from dhardy January 21, 2026 18:14
Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

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

I guess I should stop fighting this on the grounds that it is disruptive; mass-renames are not particularly hard (and this should require very few changes for someone using rand::prelude::*).

Any chance you could make a PR for rand and the book too?

/// [`next_u32`]: RngCore::next_u32
/// [`next_u64`]: RngCore::next_u64
pub trait RngCore: TryRngCore<Error = Infallible> {
/// [`rand::RngExt`]: https://docs.rs/rand/latest/rand/trait.RngExt.html
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't exist yet...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I plan to rename the rand::Rng trait in the same PR which migrates to the renamed rand_core traits.

@newpavlov
Copy link
Member Author

Any chance you could make a PR for rand and the book too?

Will do, but I first need to migrate chacha20 and cut new pre-releases.

@newpavlov newpavlov merged commit 5f5dbec into master Jan 23, 2026
13 checks passed
@newpavlov newpavlov deleted the rename_core branch January 23, 2026 13:33
@dhardy dhardy mentioned this pull request Jan 23, 2026
17 tasks
@karalabe
Copy link

Hey guys, I understand that this is an rc crate so there are no version guarantees, but you are aware right, that every time you tweak the API and push a new version, downstream users are getting broken pipelines? I understand that sometimes API changes are needed, but it's seriously annoying that I have to debug on a saturday evening becase Drop the "core" part to make the names shorter.

@dhardy
Copy link
Member

dhardy commented Jan 24, 2026

@karalabe you shouldn't need to use the latest RC version if you are not testing.

The good news is that I think we don't have any more breaking changes before the next proper release of rand_core.

@karalabe
Copy link

I'm using the x-wing stuff from https://github.com/RustCrypto/KEMs, so unfortunately I inherit the issues.

tarcieri added a commit to rust-random/rand that referenced this pull request Jan 24, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
tarcieri added a commit to rust-random/rand that referenced this pull request Jan 24, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
tarcieri added a commit to rust-random/rand that referenced this pull request Jan 24, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
tarcieri added a commit to rust-random/rand that referenced this pull request Jan 24, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
@tarcieri
Copy link
Contributor

New x-wing is out: https://crates.io/crates/x-wing/0.1.0-pre.5

tarcieri added a commit to rust-random/rand that referenced this pull request Jan 25, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
tarcieri added a commit to rust-random/rand that referenced this pull request Jan 25, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
tarcieri added a commit to rust-random/rand that referenced this pull request Jan 25, 2026
This prerelease of `rand_core` renamed `(Try)RngCore` => `(Try)Rng`.

Since `rand` previously defined an `Rng` trait, it now needs a new name,
and `RngExt` was the one I saw suggested in rust-random/rand_core#54.
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.

5 participants