core: implement Rng for references#159435
Merged
Merged
Conversation
This was referenced Jul 17, 2026
Member
|
@bors r+ |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 21, 2026
…uwer Rollup of 7 pull requests Successful merges: - #155617 (Replace `jemalloc` bootstrap options with `override-allocator`) - #156225 (feat(num): improve error messages for `TryFromIntError`) - #159058 (implement #![feature(macroless_generic_const_args)]) - #159435 (core: implement `Rng` for references) - #159471 (Make `Global` and `System` allocators unstably implement `const Clone + const Default`.) - #159590 (Remove some dead code) - #159636 (Improve some comments (and an error message))
rust-timer
added a commit
that referenced
this pull request
Jul 21, 2026
Rollup merge of #159435 - joboet:rng_ref, r=dtolnay core: implement `Rng` for references Tracking issue: #130703 Just like `Iterator` `Rng` should be implemented for references to RNGs. Aside from the functionality this adds, it also prevents inconsistent implementations. I've not added a `by_ref` method here since such a method can easily be added later and arguably should be `final`. r? libs-api
github-actions Bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Jul 23, 2026
…uwer Rollup of 7 pull requests Successful merges: - rust-lang/rust#155617 (Replace `jemalloc` bootstrap options with `override-allocator`) - rust-lang/rust#156225 (feat(num): improve error messages for `TryFromIntError`) - rust-lang/rust#159058 (implement #![feature(macroless_generic_const_args)]) - rust-lang/rust#159435 (core: implement `Rng` for references) - rust-lang/rust#159471 (Make `Global` and `System` allocators unstably implement `const Clone + const Default`.) - rust-lang/rust#159590 (Remove some dead code) - rust-lang/rust#159636 (Improve some comments (and an error message))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue: #130703
Just like
IteratorRngshould be implemented for references to RNGs. Aside from the functionality this adds, it also prevents inconsistent implementations.I've not added a
by_refmethod here since such a method can easily be added later and arguably should befinal.r? libs-api