File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1080,11 +1080,13 @@ mod prim_str {}
10801080/// * [`Debug`]
10811081/// * [`Default`]
10821082/// * [`Hash`]
1083+ /// * [`Random`]
10831084/// * [`From<[T; N]>`][from]
10841085///
10851086/// [from]: convert::From
10861087/// [`Debug`]: fmt::Debug
10871088/// [`Hash`]: hash::Hash
1089+ /// [`Random`]: random::Random
10881090///
10891091/// The following traits are implemented for tuples of any length. These traits have
10901092/// implementations that are automatically generated by the compiler, so are not limited by
Original file line number Diff line number Diff line change 33use crate :: cmp:: Ordering :: { self , * } ;
44use crate :: marker:: { ConstParamTy_ , StructuralPartialEq , UnsizedConstParamTy } ;
55use crate :: ops:: ControlFlow :: { Break , Continue } ;
6+ use crate :: random:: { Random , RandomSource } ;
67
78// Recursive macro for implementing n-ary tuple functions and operations
89//
@@ -123,6 +124,16 @@ macro_rules! tuple_impls {
123124 }
124125 }
125126
127+ maybe_tuple_doc! {
128+ $( $T) + @
129+ #[ unstable( feature = "random" , issue = "130703" ) ]
130+ impl <$( $T: Random ) ,+> Random for ( $( $T, ) +) {
131+ fn random( source: & mut ( impl RandomSource + ?Sized ) ) -> Self {
132+ ( $( { let x: $T = Random :: random( source) ; x} , ) +)
133+ }
134+ }
135+ }
136+
126137 maybe_tuple_doc! {
127138 $( $T) + @
128139 #[ stable( feature = "array_tuple_conv" , since = "1.71.0" ) ]
You can’t perform that action at this time.
0 commit comments