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 {
201201 } )
202202 }
203203 }
204+
205+ nonzero_integer_impl_div_rem!( $Ty $signedness $Int) ;
204206 } ;
205207}
206208
@@ -275,9 +277,12 @@ nonzero_leading_trailing_zeros! {
275277 NonZeroIsize ( usize ) , -1isize ;
276278}
277279
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) => {
281286 #[ stable( feature = "nonzero_div" , since = "1.51.0" ) ]
282287 impl Div <$Ty> for $Int {
283288 type Output = $Int;
@@ -302,17 +307,7 @@ macro_rules! nonzero_integers_div {
302307 unsafe { crate :: intrinsics:: unchecked_rem( self , other. get( ) ) }
303308 }
304309 }
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+ } ;
316311}
317312
318313// A bunch of methods for unsigned nonzero types only.
You can’t perform that action at this time.
0 commit comments