File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1080,11 +1080,13 @@ mod prim_str {}
1080
1080
/// * [`Debug`]
1081
1081
/// * [`Default`]
1082
1082
/// * [`Hash`]
1083
+ /// * [`Random`]
1083
1084
/// * [`From<[T; N]>`][from]
1084
1085
///
1085
1086
/// [from]: convert::From
1086
1087
/// [`Debug`]: fmt::Debug
1087
1088
/// [`Hash`]: hash::Hash
1089
+ /// [`Random`]: random::Random
1088
1090
///
1089
1091
/// The following traits are implemented for tuples of any length. These traits have
1090
1092
/// implementations that are automatically generated by the compiler, so are not limited by
Original file line number Diff line number Diff line change 3
3
use crate :: cmp:: Ordering :: { self , * } ;
4
4
use crate :: marker:: { ConstParamTy_ , StructuralPartialEq , UnsizedConstParamTy } ;
5
5
use crate :: ops:: ControlFlow :: { Break , Continue } ;
6
+ use crate :: random:: { Random , RandomSource } ;
6
7
7
8
// Recursive macro for implementing n-ary tuple functions and operations
8
9
//
@@ -123,6 +124,16 @@ macro_rules! tuple_impls {
123
124
}
124
125
}
125
126
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
+
126
137
maybe_tuple_doc! {
127
138
$( $T) + @
128
139
#[ stable( feature = "array_tuple_conv" , since = "1.71.0" ) ]
You can’t perform that action at this time.
0 commit comments