File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,12 @@ impl<T: ?Sized> *const T {
396396     /// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2); 
397397     /// ``` 
398398     #[ unstable( feature = "ptr_wrapping_offset_from" ,  issue = "41079" ) ]  
399+     #[ rustc_deprecated(  
400+         since = "1.46.0" ,  
401+         reason = "Pointer distances across allocation \   
402+          boundaries are not typically meaningful. \ 
403+          Use integer subtraction if you really need this."
404+     ) ]  
399405    #[ inline]  
400406    pub  fn  wrapping_offset_from ( self ,  origin :  * const  T )  -> isize 
401407    where 
Original file line number Diff line number Diff line change @@ -446,11 +446,18 @@ impl<T: ?Sized> *mut T {
446446     /// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2); 
447447     /// ``` 
448448     #[ unstable( feature = "ptr_wrapping_offset_from" ,  issue = "41079" ) ]  
449+     #[ rustc_deprecated(  
450+         since = "1.46.0" ,  
451+         reason = "Pointer distances across allocation \   
452+          boundaries are not typically meaningful. \ 
453+          Use integer subtraction if you really need this."
454+     ) ]  
449455    #[ inline]  
450456    pub  fn  wrapping_offset_from ( self ,  origin :  * const  T )  -> isize 
451457    where 
452458        T :  Sized , 
453459    { 
460+         #[ allow( deprecated_in_future,  deprecated) ]  
454461        ( self  as  * const  T ) . wrapping_offset_from ( origin) 
455462    } 
456463
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments