File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,8 @@ macro_rules! nonzero_integer {
201
201
} )
202
202
}
203
203
}
204
+
205
+ nonzero_integer_impl_div_rem!( $Ty $signedness $Int) ;
204
206
} ;
205
207
}
206
208
@@ -275,9 +277,12 @@ nonzero_leading_trailing_zeros! {
275
277
NonZeroIsize ( usize ) , -1isize ;
276
278
}
277
279
278
- macro_rules! nonzero_integers_div {
279
- ( $( $Ty: ident( $Int: ty) ; ) + ) => {
280
- $(
280
+ macro_rules! nonzero_integer_impl_div_rem {
281
+ ( $Ty: ident signed $Int: ty) => {
282
+ // nothing for signed ints
283
+ } ;
284
+
285
+ ( $Ty: ident unsigned $Int: ty) => {
281
286
#[ stable( feature = "nonzero_div" , since = "1.51.0" ) ]
282
287
impl Div <$Ty> for $Int {
283
288
type Output = $Int;
@@ -302,17 +307,7 @@ macro_rules! nonzero_integers_div {
302
307
unsafe { crate :: intrinsics:: unchecked_rem( self , other. get( ) ) }
303
308
}
304
309
}
305
- ) +
306
- }
307
- }
308
-
309
- nonzero_integers_div ! {
310
- NonZeroU8 ( u8 ) ;
311
- NonZeroU16 ( u16 ) ;
312
- NonZeroU32 ( u32 ) ;
313
- NonZeroU64 ( u64 ) ;
314
- NonZeroU128 ( u128 ) ;
315
- NonZeroUsize ( usize ) ;
310
+ } ;
316
311
}
317
312
318
313
// A bunch of methods for unsigned nonzero types only.
You can’t perform that action at this time.
0 commit comments