@@ -2,15 +2,14 @@ macro_rules! uint_module {
22 ( $T: ident) => {
33 use core:: num:: ParseIntError ;
44 use core:: ops:: { BitAnd , BitOr , BitXor , Not , Shl , Shr } ;
5- use core:: $T:: * ;
65
76 use crate :: num;
87
98 #[ test]
109 fn test_overflows( ) {
11- assert!( MAX > 0 ) ;
12- assert!( MIN <= 0 ) ;
13- assert!( ( MIN + MAX ) . wrapping_add( 1 ) == 0 ) ;
10+ assert!( $T :: MAX > 0 ) ;
11+ assert!( $T :: MIN <= 0 ) ;
12+ assert!( ( $T :: MIN + $T :: MAX ) . wrapping_add( 1 ) == 0 ) ;
1413 }
1514
1615 #[ test]
@@ -25,7 +24,7 @@ macro_rules! uint_module {
2524 assert!( 0b0110 as $T == ( 0b1100 as $T) . bitxor( 0b1010 as $T) ) ;
2625 assert!( 0b1110 as $T == ( 0b0111 as $T) . shl( 1 ) ) ;
2726 assert!( 0b0111 as $T == ( 0b1110 as $T) . shr( 1 ) ) ;
28- assert!( MAX - ( 0b1011 as $T) == ( 0b1011 as $T) . not( ) ) ;
27+ assert!( $T :: MAX - ( 0b1011 as $T) == ( 0b1011 as $T) . not( ) ) ;
2928 }
3029
3130 const A : $T = 0b0101100 ;
@@ -361,7 +360,7 @@ macro_rules! uint_module {
361360 assert_eq_const_safe!( $T: R . wrapping_pow( 2 ) , 1 as $T) ;
362361 assert_eq_const_safe!( Option <$T>: R . checked_pow( 2 ) , None ) ;
363362 assert_eq_const_safe!( ( $T, bool ) : R . overflowing_pow( 2 ) , ( 1 as $T, true ) ) ;
364- assert_eq_const_safe!( $T: R . saturating_pow( 2 ) , MAX ) ;
363+ assert_eq_const_safe!( $T: R . saturating_pow( 2 ) , $T :: MAX ) ;
365364 }
366365 }
367366
@@ -468,14 +467,14 @@ macro_rules! uint_module {
468467 fn test_next_multiple_of( ) {
469468 assert_eq_const_safe!( $T: ( 16 as $T) . next_multiple_of( 8 ) , 16 ) ;
470469 assert_eq_const_safe!( $T: ( 23 as $T) . next_multiple_of( 8 ) , 24 ) ;
471- assert_eq_const_safe!( $T: MAX . next_multiple_of( 1 ) , MAX ) ;
470+ assert_eq_const_safe!( $T: $T :: MAX . next_multiple_of( 1 ) , $T :: MAX ) ;
472471 }
473472
474473 fn test_checked_next_multiple_of( ) {
475474 assert_eq_const_safe!( Option <$T>: ( 16 as $T) . checked_next_multiple_of( 8 ) , Some ( 16 ) ) ;
476475 assert_eq_const_safe!( Option <$T>: ( 23 as $T) . checked_next_multiple_of( 8 ) , Some ( 24 ) ) ;
477476 assert_eq_const_safe!( Option <$T>: ( 1 as $T) . checked_next_multiple_of( 0 ) , None ) ;
478- assert_eq_const_safe!( Option <$T>: MAX . checked_next_multiple_of( 2 ) , None ) ;
477+ assert_eq_const_safe!( Option <$T>: $T :: MAX . checked_next_multiple_of( 2 ) , None ) ;
479478 }
480479
481480 fn test_is_next_multiple_of( ) {
0 commit comments