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 @@ -330,6 +330,12 @@ impl<T: ?Sized> *const T {
330330 /// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
331331 /// ```
332332 #[ unstable( feature = "ptr_wrapping_offset_from" , issue = "41079" ) ]
333+ #[ rustc_deprecated(
334+ since = "1.46.0" ,
335+ reason = "Pointer distances across allocation \
336+ boundaries are not typically meaningful. \
337+ Use integer subtraction if you really need this."
338+ ) ]
333339 #[ inline]
334340 pub fn wrapping_offset_from ( self , origin : * const T ) -> isize
335341 where
Original file line number Diff line number Diff line change @@ -380,11 +380,18 @@ impl<T: ?Sized> *mut T {
380380 /// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
381381 /// ```
382382 #[ unstable( feature = "ptr_wrapping_offset_from" , issue = "41079" ) ]
383+ #[ rustc_deprecated(
384+ since = "1.46.0" ,
385+ reason = "Pointer distances across allocation \
386+ boundaries are not typically meaningful. \
387+ Use integer subtraction if you really need this."
388+ ) ]
383389 #[ inline]
384390 pub fn wrapping_offset_from ( self , origin : * const T ) -> isize
385391 where
386392 T : Sized ,
387393 {
394+ #[ allow( deprecated_in_future, deprecated) ]
388395 ( self as * const T ) . wrapping_offset_from ( origin)
389396 }
390397
You can’t perform that action at this time.
0 commit comments