@@ -582,7 +582,7 @@ impl<T: ?Sized> *const T {
582
582
intrinsics:: ptr_mask ( self . cast :: < ( ) > ( ) , mask) . with_metadata_of ( self )
583
583
}
584
584
585
- /// Calculates the distance between two pointers. The returned value is in
585
+ /// Calculates the distance between two pointers within the same allocation . The returned value is in
586
586
/// units of T: the distance in bytes divided by `mem::size_of::<T>()`.
587
587
///
588
588
/// This is equivalent to `(self as isize - origin as isize) / (mem::size_of::<T>() as isize)`,
@@ -677,7 +677,7 @@ impl<T: ?Sized> *const T {
677
677
unsafe { intrinsics:: ptr_offset_from ( self , origin) }
678
678
}
679
679
680
- /// Calculates the distance between two pointers. The returned value is in
680
+ /// Calculates the distance between two pointers within the same allocation . The returned value is in
681
681
/// units of **bytes**.
682
682
///
683
683
/// This is purely a convenience for casting to a `u8` pointer and
@@ -695,7 +695,7 @@ impl<T: ?Sized> *const T {
695
695
unsafe { self . cast :: < u8 > ( ) . offset_from ( origin. cast :: < u8 > ( ) ) }
696
696
}
697
697
698
- /// Calculates the distance between two pointers, *where it's known that
698
+ /// Calculates the distance between two pointers within the same allocation , *where it's known that
699
699
/// `self` is equal to or greater than `origin`*. The returned value is in
700
700
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
701
701
///
@@ -790,7 +790,7 @@ impl<T: ?Sized> *const T {
790
790
unsafe { intrinsics:: ptr_offset_from_unsigned ( self , origin) }
791
791
}
792
792
793
- /// Calculates the distance between two pointers, *where it's known that
793
+ /// Calculates the distance between two pointers within the same allocation , *where it's known that
794
794
/// `self` is equal to or greater than `origin`*. The returned value is in
795
795
/// units of **bytes**.
796
796
///
0 commit comments