@@ -95,12 +95,6 @@ depending on the target pointer size.
9595
9696macro_rules! widening_impl {
9797 ( $SelfT: ty, $WideT: ty, $BITS: literal, unsigned) => {
98- widening_impl!( $SelfT, $WideT, $BITS, "" ) ;
99- } ;
100- ( $SelfT: ty, $WideT: ty, $BITS: literal, signed) => {
101- widening_impl!( $SelfT, $WideT, $BITS, "# //" ) ;
102- } ;
103- ( $SelfT: ty, $WideT: ty, $BITS: literal, $AdaptiveTestPrefix: literal) => {
10498 /// Calculates the complete product `self * rhs` without the possibility to overflow.
10599 ///
106100 /// This returns the low-order (wrapping) bits and the high-order (overflow) bits
@@ -154,7 +148,7 @@ macro_rules! widening_impl {
154148 /// assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
155149 /// assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
156150 /// assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
157- #[ doc = concat!( $AdaptiveTestPrefix , "assert_eq!(" ,
151+ #[ doc = concat!( "assert_eq!(" ,
158152 stringify!( $SelfT) , "::MAX.carrying_mul(" , stringify!( $SelfT) , "::MAX, " , stringify!( $SelfT) , "::MAX), " ,
159153 "(0, " , stringify!( $SelfT) , "::MAX));"
160154 ) ]
@@ -203,22 +197,19 @@ macro_rules! widening_impl {
203197impl i8 {
204198 int_impl ! { i8 , i8 , u8 , 8 , 7 , -128 , 127 , 2 , "-0x7e" , "0xa" , "0x12" , "0x12" , "0x48" ,
205199 "[0x12]" , "[0x12]" , "" , "" }
206- widening_impl ! { i8 , i16 , 8 , signed }
207200}
208201
209202#[ lang = "i16" ]
210203impl i16 {
211204 int_impl ! { i16 , i16 , u16 , 16 , 15 , -32768 , 32767 , 4 , "-0x5ffd" , "0x3a" , "0x1234" , "0x3412" ,
212205 "0x2c48" , "[0x34, 0x12]" , "[0x12, 0x34]" , "" , "" }
213- widening_impl ! { i16 , i32 , 16 , signed }
214206}
215207
216208#[ lang = "i32" ]
217209impl i32 {
218210 int_impl ! { i32 , i32 , u32 , 32 , 31 , -2147483648 , 2147483647 , 8 , "0x10000b3" , "0xb301" ,
219211 "0x12345678" , "0x78563412" , "0x1e6a2c48" , "[0x78, 0x56, 0x34, 0x12]" ,
220212 "[0x12, 0x34, 0x56, 0x78]" , "" , "" }
221- widening_impl ! { i32 , i64 , 32 , signed }
222213}
223214
224215#[ lang = "i64" ]
@@ -227,7 +218,6 @@ impl i64 {
227218 "0xaa00000000006e1" , "0x6e10aa" , "0x1234567890123456" , "0x5634129078563412" ,
228219 "0x6a2c48091e6a2c48" , "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]" ,
229220 "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]" , "" , "" }
230- widening_impl ! { i64 , i128 , 64 , signed }
231221}
232222
233223#[ lang = "i128" ]
@@ -248,7 +238,6 @@ impl isize {
248238 int_impl ! { isize , i16 , usize , 16 , 15 , -32768 , 32767 , 4 , "-0x5ffd" , "0x3a" , "0x1234" ,
249239 "0x3412" , "0x2c48" , "[0x34, 0x12]" , "[0x12, 0x34]" ,
250240 usize_isize_to_xe_bytes_doc!( ) , usize_isize_from_xe_bytes_doc!( ) }
251- widening_impl ! { isize , i32 , 16 , signed }
252241}
253242
254243#[ cfg( target_pointer_width = "32" ) ]
@@ -258,7 +247,6 @@ impl isize {
258247 "0x12345678" , "0x78563412" , "0x1e6a2c48" , "[0x78, 0x56, 0x34, 0x12]" ,
259248 "[0x12, 0x34, 0x56, 0x78]" ,
260249 usize_isize_to_xe_bytes_doc!( ) , usize_isize_from_xe_bytes_doc!( ) }
261- widening_impl ! { isize , i64 , 32 , signed }
262250}
263251
264252#[ cfg( target_pointer_width = "64" ) ]
@@ -269,7 +257,6 @@ impl isize {
269257 "0x6a2c48091e6a2c48" , "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]" ,
270258 "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]" ,
271259 usize_isize_to_xe_bytes_doc!( ) , usize_isize_from_xe_bytes_doc!( ) }
272- widening_impl ! { isize , i128 , 64 , signed }
273260}
274261
275262/// If 6th bit set ascii is upper case.
0 commit comments