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 @@ -1078,11 +1078,13 @@ mod prim_str {}
10781078/// * [`Debug`]
10791079/// * [`Default`]
10801080/// * [`Hash`]
1081+ /// * [`Random`]
10811082/// * [`From<[T; N]>`][from]
10821083///
10831084/// [from]: convert::From
10841085/// [`Debug`]: fmt::Debug
10851086/// [`Hash`]: hash::Hash
1087+ /// [`Random`]: random::Random
10861088///
10871089/// The following traits are implemented for tuples of any length. These traits have
10881090/// 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 :: { self , Break , Continue } ;
6+ use crate :: random:: { Random , RandomSource } ;
67
78// Recursive macro for implementing n-ary tuple functions and operations
89//
@@ -139,6 +140,16 @@ macro_rules! tuple_impls {
139140 }
140141 }
141142
143+ maybe_tuple_doc! {
144+ $( $T) + @
145+ #[ unstable( feature = "random" , issue = "130703" ) ]
146+ impl <$( $T: Random ) ,+> Random for ( $( $T, ) +) {
147+ fn random( source: & mut ( impl RandomSource + ?Sized ) ) -> Self {
148+ ( $( { let x: $T = Random :: random( source) ; x} , ) +)
149+ }
150+ }
151+ }
152+
142153 maybe_tuple_doc! {
143154 $( $T) + @
144155 #[ stable( feature = "array_tuple_conv" , since = "1.71.0" ) ]
You can’t perform that action at this time.
0 commit comments