@@ -106,7 +106,7 @@ unsafe trait GenericRadix: Sized {
106106 // SAFETY: The only chars in `buf` are created by `Self::digit` which are assumed to be
107107 // valid UTF-8
108108 let buf = unsafe {
109- str:: from_utf8_unchecked ( slice:: from_raw_parts ( buf. as_ptr ( ) . into_inner ( ) , buf. len ( ) ) )
109+ str:: from_utf8_unchecked ( slice:: from_raw_parts ( buf. as_ptr ( ) . cast :: < u8 > ( ) , buf. len ( ) ) )
110110 } ;
111111 f. pad_integral ( is_nonnegative, Self :: PREFIX , buf)
112112 }
@@ -213,7 +213,7 @@ macro_rules! impl_Display {
213213 // 2^128 is about 3*10^38, so 39 gives an extra byte of space
214214 let mut buf = [ MaybeUninit :: <u8 >:: uninit( ) ; 39 ] ;
215215 let mut curr = buf. len( ) ;
216- let buf_ptr = buf. as_mut_ptr( ) . into_inner ( ) ;
216+ let buf_ptr = buf. as_mut_ptr( ) . cast :: < u8 > ( ) ;
217217 let lut_ptr = DEC_DIGITS_LUT . as_ptr( ) ;
218218
219219 // SAFETY: Since `d1` and `d2` are always less than or equal to `198`, we
@@ -341,7 +341,7 @@ macro_rules! impl_Exp {
341341 // that `curr >= 0`.
342342 let mut buf = [ MaybeUninit :: <u8 >:: uninit( ) ; 40 ] ;
343343 let mut curr = buf. len( ) ; //index for buf
344- let buf_ptr = buf. as_mut_ptr( ) . into_inner ( ) ;
344+ let buf_ptr = buf. as_mut_ptr( ) . cast :: < u8 > ( ) ;
345345 let lut_ptr = DEC_DIGITS_LUT . as_ptr( ) ;
346346
347347 // decode 2 chars at a time
@@ -397,11 +397,11 @@ 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. as_mut_ptr( ) . into_inner ( ) . add ( 1 ) , 2 ) ; }
400+ unsafe { ptr:: copy_nonoverlapping( lut_ptr. add( off) , exp_buf. as_mut_ptr( ) . add ( 1 ) . cast :: < u8 > ( ) , 2 ) ; }
401401 3
402402 } ;
403403 // SAFETY: max(2, 3) <= 3
404- unsafe { slice:: from_raw_parts( exp_buf. as_mut_ptr( ) . into_inner ( ) , len) }
404+ unsafe { slice:: from_raw_parts( exp_buf. as_mut_ptr( ) . cast :: < u8 > ( ) , len) }
405405 } ;
406406
407407 let parts = & [
@@ -481,7 +481,7 @@ impl_Exp!(i128, u128 as u128 via to_u128 named exp_u128);
481481
482482/// Helper function for writing a u64 into `buf` going from last to first, with `curr`.
483483fn parse_u64_into < const N : usize > ( mut n : u64 , buf : & mut [ MaybeUninit < u8 > ; N ] , curr : & mut usize ) {
484- let buf_ptr = buf. as_mut_ptr ( ) . into_inner ( ) ;
484+ let buf_ptr = buf. as_mut_ptr ( ) . cast :: < u8 > ( ) ;
485485 let lut_ptr = DEC_DIGITS_LUT . as_ptr ( ) ;
486486 assert ! ( * curr > 19 ) ;
487487
@@ -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. as_mut_ptr ( ) . add ( curr) . into_inner ( ) ,
631+ buf. as_mut_ptr ( ) . add ( curr) . cast :: < u8 > ( ) ,
632632 buf. len ( ) - curr,
633633 ) )
634634 } ;
0 commit comments