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 @@ -1078,11 +1078,13 @@ mod prim_str {}
1078
1078
/// * [`Debug`]
1079
1079
/// * [`Default`]
1080
1080
/// * [`Hash`]
1081
+ /// * [`Random`]
1081
1082
/// * [`From<[T; N]>`][from]
1082
1083
///
1083
1084
/// [from]: convert::From
1084
1085
/// [`Debug`]: fmt::Debug
1085
1086
/// [`Hash`]: hash::Hash
1087
+ /// [`Random`]: random::Random
1086
1088
///
1087
1089
/// The following traits are implemented for tuples of any length. These traits have
1088
1090
/// 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 :: { self , Break , Continue } ;
6
+ use crate :: random:: { Random , RandomSource } ;
6
7
7
8
// Recursive macro for implementing n-ary tuple functions and operations
8
9
//
@@ -139,6 +140,16 @@ macro_rules! tuple_impls {
139
140
}
140
141
}
141
142
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
+
142
153
maybe_tuple_doc! {
143
154
$( $T) + @
144
155
#[ stable( feature = "array_tuple_conv" , since = "1.71.0" ) ]
You can’t perform that action at this time.
0 commit comments