Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,8 @@ impl<T: PointeeSized> *const T {
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
/// objects is not known at compile-time. However, the requirement also exists at
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
/// pointers that are not guaranteed to be from the same allocation, use `(self as isize -
/// origin as isize) / size_of::<T>()`.
// FIXME: recommend `addr()` instead of `as usize` once that is stable.
/// pointers that are not guaranteed to be from the same allocation, use
/// `(self.addr() as isize - origin.addr() as isize) / size_of::<T>()`.
///
/// [`add`]: #method.add
/// [allocation]: crate::ptr#allocation
Expand Down
5 changes: 2 additions & 3 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,8 @@ impl<T: PointeeSized> *mut T {
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
/// objects is not known at compile-time. However, the requirement also exists at
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
/// pointers that are not guaranteed to be from the same allocation, use `(self as isize -
/// origin as isize) / size_of::<T>()`.
// FIXME: recommend `addr()` instead of `as usize` once that is stable.
/// pointers that are not guaranteed to be from the same allocation, use
/// `(self.addr() as isize - origin.addr() as isize) / size_of::<T>()`.
///
/// [`add`]: #method.add
/// [allocation]: crate::ptr#allocation
Expand Down
5 changes: 2 additions & 3 deletions library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,8 @@ impl<T: PointeeSized> NonNull<T> {
/// needed for `const`-compatibility: the distance between pointers into *different* allocated
/// objects is not known at compile-time. However, the requirement also exists at
/// runtime and may be exploited by optimizations. If you wish to compute the difference between
/// pointers that are not guaranteed to be from the same allocation, use `(self as isize -
/// origin as isize) / size_of::<T>()`.
// FIXME: recommend `addr()` instead of `as usize` once that is stable.
/// pointers that are not guaranteed to be from the same allocation, use
/// `(self.addr() as isize - origin.addr() as isize) / size_of::<T>()`.
///
/// [`add`]: #method.add
/// [allocation]: crate::ptr#allocation
Expand Down
Loading