@@ -19,8 +19,8 @@ use core::arch::x86_64::__m512i;
19
19
#[ cfg( target_arch = "x86_64" ) ]
20
20
use core:: arch:: x86_64:: { __m128i, __m256i} ;
21
21
use core:: num:: {
22
- NonZeroI128 , NonZeroI16 , NonZeroI32 , NonZeroI64 , NonZeroI8 , NonZeroIsize , NonZeroU128 ,
23
- NonZeroU16 , NonZeroU32 , NonZeroU64 , NonZeroU8 , NonZeroUsize ,
22
+ NonZeroI128 , NonZeroI16 , NonZeroI32 , NonZeroI64 , NonZeroI8 , NonZeroU128 , NonZeroU16 ,
23
+ NonZeroU32 , NonZeroU64 , NonZeroU8 ,
24
24
} ;
25
25
#[ cfg( feature = "simd_support" ) ]
26
26
use core:: simd:: * ;
@@ -63,20 +63,6 @@ impl Distribution<u128> for Standard {
63
63
}
64
64
}
65
65
66
- impl Distribution < usize > for Standard {
67
- #[ inline]
68
- #[ cfg( any( target_pointer_width = "32" , target_pointer_width = "16" ) ) ]
69
- fn sample < R : Rng + ?Sized > ( & self , rng : & mut R ) -> usize {
70
- rng. next_u32 ( ) as usize
71
- }
72
-
73
- #[ inline]
74
- #[ cfg( target_pointer_width = "64" ) ]
75
- fn sample < R : Rng + ?Sized > ( & self , rng : & mut R ) -> usize {
76
- rng. next_u64 ( ) as usize
77
- }
78
- }
79
-
80
66
macro_rules! impl_int_from_uint {
81
67
( $ty: ty, $uty: ty) => {
82
68
impl Distribution <$ty> for Standard {
@@ -93,7 +79,6 @@ impl_int_from_uint! { i16, u16 }
93
79
impl_int_from_uint ! { i32 , u32 }
94
80
impl_int_from_uint ! { i64 , u64 }
95
81
impl_int_from_uint ! { i128 , u128 }
96
- impl_int_from_uint ! { isize , usize }
97
82
98
83
macro_rules! impl_nzint {
99
84
( $ty: ty, $new: path) => {
@@ -114,14 +99,12 @@ impl_nzint!(NonZeroU16, NonZeroU16::new);
114
99
impl_nzint ! ( NonZeroU32 , NonZeroU32 :: new) ;
115
100
impl_nzint ! ( NonZeroU64 , NonZeroU64 :: new) ;
116
101
impl_nzint ! ( NonZeroU128 , NonZeroU128 :: new) ;
117
- impl_nzint ! ( NonZeroUsize , NonZeroUsize :: new) ;
118
102
119
103
impl_nzint ! ( NonZeroI8 , NonZeroI8 :: new) ;
120
104
impl_nzint ! ( NonZeroI16 , NonZeroI16 :: new) ;
121
105
impl_nzint ! ( NonZeroI32 , NonZeroI32 :: new) ;
122
106
impl_nzint ! ( NonZeroI64 , NonZeroI64 :: new) ;
123
107
impl_nzint ! ( NonZeroI128 , NonZeroI128 :: new) ;
124
- impl_nzint ! ( NonZeroIsize , NonZeroIsize :: new) ;
125
108
126
109
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
127
110
macro_rules! x86_intrinsic_impl {
@@ -163,7 +146,7 @@ macro_rules! simd_impl {
163
146
}
164
147
165
148
#[ cfg( feature = "simd_support" ) ]
166
- simd_impl ! ( u8 , i8 , u16 , i16 , u32 , i32 , u64 , i64 , usize , isize ) ;
149
+ simd_impl ! ( u8 , i8 , u16 , i16 , u32 , i32 , u64 , i64 ) ;
167
150
168
151
#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
169
152
x86_intrinsic_impl ! (
@@ -191,14 +174,12 @@ mod tests {
191
174
fn test_integers ( ) {
192
175
let mut rng = crate :: test:: rng ( 806 ) ;
193
176
194
- rng. sample :: < isize , _ > ( Standard ) ;
195
177
rng. sample :: < i8 , _ > ( Standard ) ;
196
178
rng. sample :: < i16 , _ > ( Standard ) ;
197
179
rng. sample :: < i32 , _ > ( Standard ) ;
198
180
rng. sample :: < i64 , _ > ( Standard ) ;
199
181
rng. sample :: < i128 , _ > ( Standard ) ;
200
182
201
- rng. sample :: < usize , _ > ( Standard ) ;
202
183
rng. sample :: < u8 , _ > ( Standard ) ;
203
184
rng. sample :: < u16 , _ > ( Standard ) ;
204
185
rng. sample :: < u32 , _ > ( Standard ) ;
@@ -239,17 +220,6 @@ mod tests {
239
220
111087889832015897993126088499035356354 ,
240
221
] ,
241
222
) ;
242
- #[ cfg( any( target_pointer_width = "32" , target_pointer_width = "16" ) ) ]
243
- test_samples ( 0usize , & [ 2220326409 , 2575017975 , 2018088303 ] ) ;
244
- #[ cfg( target_pointer_width = "64" ) ]
245
- test_samples (
246
- 0usize ,
247
- & [
248
- 11059617991457472009 ,
249
- 16096616328739788143 ,
250
- 1487364411147516184 ,
251
- ] ,
252
- ) ;
253
223
254
224
test_samples ( 0i8 , & [ 9 , -9 , 111 ] ) ;
255
225
// Skip further i* types: they are simple reinterpretation of u* samples
0 commit comments