Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Random for tuple #136801

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sorairolake
Copy link
Contributor

Implement Random for tuples of arity 12 or less. Each element is expected to implement Random.

I think it's OK to implement this trait for the following types:

  • Primitive integer types and bool
  • Arrays and tuples of the above values
  • NonZero<T>, Saturating<T> and Wrapping<T>

The necessity of this trait is debated (#130703 (comment)), but if we decide to keep it in the future when the random module is stabilized, I think it would be useful to have this trait implemented for tuples.

Tracking issue: #130703

r? @joboet

Implement `Random` for tuples of arity 12 or less. Each element is
expected to implement `Random`.
@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 Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants