File tree 2 files changed +13
-0
lines changed
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 {
396
396
/// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
397
397
/// ```
398
398
#[ 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
+ ) ]
399
405
#[ inline]
400
406
pub fn wrapping_offset_from ( self , origin : * const T ) -> isize
401
407
where
Original file line number Diff line number Diff line change @@ -446,11 +446,18 @@ impl<T: ?Sized> *mut T {
446
446
/// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
447
447
/// ```
448
448
#[ 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
+ ) ]
449
455
#[ inline]
450
456
pub fn wrapping_offset_from ( self , origin : * const T ) -> isize
451
457
where
452
458
T : Sized ,
453
459
{
460
+ #[ allow( deprecated_in_future, deprecated) ]
454
461
( self as * const T ) . wrapping_offset_from ( origin)
455
462
}
456
463
You can’t perform that action at this time.
0 commit comments