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