File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,10 @@ impl HInt for u128 {
222
222
fn widen_mul ( self , rhs : Self ) -> Self :: D {
223
223
self . zero_widen_mul ( rhs)
224
224
}
225
+
226
+ fn widen_hi ( self ) -> Self :: D {
227
+ self . widen ( ) << <Self as MinInt >:: BITS
228
+ }
225
229
}
226
230
227
231
impl HInt for i128 {
@@ -247,6 +251,10 @@ impl HInt for i128 {
247
251
fn widen_mul ( self , rhs : Self ) -> Self :: D {
248
252
unimplemented ! ( "signed i128 widening multiply is not used" )
249
253
}
254
+
255
+ fn widen_hi ( self ) -> Self :: D {
256
+ self . widen ( ) << <Self as MinInt >:: BITS
257
+ }
250
258
}
251
259
252
260
impl DInt for u256 {
Original file line number Diff line number Diff line change @@ -319,9 +319,7 @@ pub(crate) trait HInt: Int {
319
319
/// around problems with associated type bounds (such as `Int<Othersign: DInt>`) being unstable
320
320
fn zero_widen( self ) -> Self :: D ;
321
321
/// Widens the integer to have double bit width and shifts the integer into the higher bits
322
- fn widen_hi( self ) -> Self :: D {
323
- self . widen( ) << <Self as MinInt >:: BITS
324
- }
322
+ fn widen_hi( self ) -> Self :: D ;
325
323
/// Widening multiplication with zero widening. This cannot overflow.
326
324
fn zero_widen_mul( self , rhs: Self ) -> Self :: D ;
327
325
/// Widening multiplication. This cannot overflow.
@@ -364,6 +362,9 @@ macro_rules! impl_h_int {
364
362
fn widen_mul( self , rhs: Self ) -> Self :: D {
365
363
self . widen( ) . wrapping_mul( rhs. widen( ) )
366
364
}
365
+ fn widen_hi( self ) -> Self :: D {
366
+ ( self as $X) << <Self as MinInt >:: BITS
367
+ }
367
368
}
368
369
) *
369
370
} ;
You can’t perform that action at this time.
0 commit comments