rust/library/core
Guillaume Gomez ad6503983d
Rollup merge of #136801 - sorairolake:add-random-for-tuple, r=joshtriplett
Implement `Random` for tuple

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 (<https://github.com/rust-lang/rust/issues/130703#issuecomment-2508889577>), 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`
2025-07-01 17:46:59 +02:00
..
src Rollup merge of #136801 - sorairolake:add-random-for-tuple, r=joshtriplett 2025-07-01 17:46:59 +02:00
Cargo.toml Add new Tier-3 targets: loongarch32-unknown-none* 2025-06-06 08:19:38 +08:00