File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ impl<T: ?Sized> *const T {
684684    #[ unstable( feature = "pointer_byte_offsets" ,  issue = "96283" ) ]  
685685    #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" ,  issue = "96283" ) ]  
686686    #[ cfg_attr( miri,  track_caller) ]   // even without panics, this helps for Miri backtraces 
687-     pub  const  unsafe  fn  byte_offset_from ( self ,  origin :  * const  T )  -> isize  { 
687+     pub  const  unsafe  fn  byte_offset_from < U :  ? Sized > ( self ,  origin :  * const  U )  -> isize  { 
688688        // SAFETY: the caller must uphold the safety contract for `offset_from`. 
689689        unsafe  {  self . cast :: < u8 > ( ) . offset_from ( origin. cast :: < u8 > ( ) )  } 
690690    } 
Original file line number Diff line number Diff line change @@ -861,7 +861,7 @@ impl<T: ?Sized> *mut T {
861861    #[ unstable( feature = "pointer_byte_offsets" ,  issue = "96283" ) ]  
862862    #[ rustc_const_unstable( feature = "const_pointer_byte_offsets" ,  issue = "96283" ) ]  
863863    #[ cfg_attr( miri,  track_caller) ]   // even without panics, this helps for Miri backtraces 
864-     pub  const  unsafe  fn  byte_offset_from ( self ,  origin :  * const  T )  -> isize  { 
864+     pub  const  unsafe  fn  byte_offset_from < U :  ? Sized > ( self ,  origin :  * const  U )  -> isize  { 
865865        // SAFETY: the caller must uphold the safety contract for `offset_from`. 
866866        unsafe  {  self . cast :: < u8 > ( ) . offset_from ( origin. cast :: < u8 > ( ) )  } 
867867    } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments