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 @@ -1082,11 +1082,13 @@ mod prim_str {}
10821082/// * [`Debug`]
10831083/// * [`Default`]
10841084/// * [`Hash`]
1085+ /// * [`Random`]
10851086/// * [`From<[T; N]>`][from]
10861087///
10871088/// [from]: convert::From
10881089/// [`Debug`]: fmt::Debug
10891090/// [`Hash`]: hash::Hash
1091+ /// [`Random`]: random::Random
10901092///
10911093/// The following traits are implemented for tuples of any length. These traits have
10921094/// implementations that are automatically generated by the compiler, so are not limited by
Original file line number Diff line number Diff line change 22
33use crate :: cmp:: Ordering :: { self , * } ;
44use crate :: marker:: { ConstParamTy_ , StructuralPartialEq , UnsizedConstParamTy } ;
5+ use crate :: random:: { Random , RandomSource } ;
56
67// Recursive macro for implementing n-ary tuple functions and operations
78//
@@ -122,6 +123,16 @@ macro_rules! tuple_impls {
122123 }
123124 }
124125
126+ maybe_tuple_doc! {
127+ $( $T) + @
128+ #[ unstable( feature = "random" , issue = "130703" ) ]
129+ impl <$( $T: Random ) ,+> Random for ( $( $T, ) +) {
130+ fn random( source: & mut ( impl RandomSource + ?Sized ) ) -> Self {
131+ ( $( { let x: $T = Random :: random( source) ; x} , ) +)
132+ }
133+ }
134+ }
135+
125136 maybe_tuple_doc! {
126137 $( $T) + @
127138 #[ stable( feature = "array_tuple_conv" , since = "1.71.0" ) ]
You can’t perform that action at this time.
0 commit comments