Skip to content

core: implement Rng for references#159435

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
joboet:rng_ref
Jul 21, 2026
Merged

core: implement Rng for references#159435
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
joboet:rng_ref

Conversation

@joboet

@joboet joboet commented Jul 17, 2026

Copy link
Copy Markdown
Member

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 17, 2026
@joboet joboet added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-random Area: random data generation support labels Jul 17, 2026

@dtolnay dtolnay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@dtolnay

dtolnay commented Jul 21, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 93f4a70 has been approved by dtolnay

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 21, 2026
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-bors
rust-bors Bot merged commit 4430314 into rust-lang:main Jul 21, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 21, 2026
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-random Area: random data generation support S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants