@@ -397,7 +397,7 @@ macro_rules! impl_Exp {
397397 } else {
398398 let off = exponent << 1 ;
399399 // 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 ) ; }
401401 3
402402 } ;
403403 // SAFETY: max(2, 3) <= 3
@@ -605,7 +605,7 @@ fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::R
605605 // SAFETY: Guaranteed that we wrote at most 19 bytes, and there must be space
606606 // remaining since it has length 39
607607 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) ;
609609 }
610610 curr = target;
611611
@@ -617,7 +617,7 @@ fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::R
617617 // SAFETY: At this point we wrote at most 38 bytes, pad up to that point,
618618 // There can only be at most 1 digit remaining.
619619 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) ;
621621 }
622622 curr = target - 1 ;
623623 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
628628 // UTF-8 since `DEC_DIGITS_LUT` is
629629 let buf_slice = unsafe {
630630 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 ( ) ,
632632 buf. len ( ) - curr,
633633 ) )
634634 } ;
0 commit comments