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 @@ -330,6 +330,12 @@ impl<T: ?Sized> *const T {
330
330
/// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
331
331
/// ```
332
332
#[ 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
+ ) ]
333
339
#[ inline]
334
340
pub fn wrapping_offset_from ( self , origin : * const T ) -> isize
335
341
where
Original file line number Diff line number Diff line change @@ -380,11 +380,18 @@ impl<T: ?Sized> *mut T {
380
380
/// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
381
381
/// ```
382
382
#[ 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
+ ) ]
383
389
#[ inline]
384
390
pub fn wrapping_offset_from ( self , origin : * const T ) -> isize
385
391
where
386
392
T : Sized ,
387
393
{
394
+ #[ allow( deprecated_in_future, deprecated) ]
388
395
( self as * const T ) . wrapping_offset_from ( origin)
389
396
}
390
397
You can’t perform that action at this time.
0 commit comments