@@ -397,7 +397,7 @@ macro_rules! impl_Exp {
397
397
} else {
398
398
let off = exponent << 1 ;
399
399
// SAFETY: 1 + 2 <= 3
400
- unsafe { ptr:: copy_nonoverlapping( lut_ptr. add( off) , exp_buf[ 1 ] . as_mut_ptr( ) , 2 ) ; }
400
+ unsafe { ptr:: copy_nonoverlapping( lut_ptr. add( off) , exp_buf. as_mut_ptr( ) . into_inner ( ) . add ( 1 ) , 2 ) ; }
401
401
3
402
402
} ;
403
403
// SAFETY: max(2, 3) <= 3
@@ -605,7 +605,7 @@ fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::R
605
605
// SAFETY: Guaranteed that we wrote at most 19 bytes, and there must be space
606
606
// remaining since it has length 39
607
607
unsafe {
608
- ptr:: write_bytes ( buf[ target ] . as_mut_ptr ( ) , b'0' , curr - target) ;
608
+ ptr:: write_bytes ( buf. as_mut_ptr ( ) . add ( target ) , b'0' , curr - target) ;
609
609
}
610
610
curr = target;
611
611
@@ -617,7 +617,7 @@ fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::R
617
617
// SAFETY: At this point we wrote at most 38 bytes, pad up to that point,
618
618
// There can only be at most 1 digit remaining.
619
619
unsafe {
620
- ptr:: write_bytes ( buf[ target ] . as_mut_ptr ( ) , b'0' , curr - target) ;
620
+ ptr:: write_bytes ( buf. as_mut_ptr ( ) . add ( target ) , b'0' , curr - target) ;
621
621
}
622
622
curr = target - 1 ;
623
623
buf[ curr] . write ( ( n as u8 ) + b'0' ) ;
@@ -628,7 +628,7 @@ fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::R
628
628
// UTF-8 since `DEC_DIGITS_LUT` is
629
629
let buf_slice = unsafe {
630
630
str:: from_utf8_unchecked ( slice:: from_raw_parts (
631
- buf. get_unchecked_mut ( curr) . as_mut_ptr ( ) ,
631
+ buf. as_mut_ptr ( ) . add ( curr) . into_inner ( ) ,
632
632
buf. len ( ) - curr,
633
633
) )
634
634
} ;
0 commit comments