Skip to content

Commit dcb7479

Browse files
Rollup merge of #81168 - soniasingla:doc/sonia, r=jonas-schievink
Fixes #81109 - Typo in pointer::wrapping_sub Signed-off-by: soniasingla <soniasingla.1812@gmail.com> Related to issue #81109
2 parents 7aa3920 + 47c2476 commit dcb7479

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/core/src/ptr/const_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ impl<T: ?Sized> *const T {
633633
}
634634

635635
/// Calculates the offset from a pointer using wrapping arithmetic.
636-
/// (convenience for `.wrapping_offset((count as isize).wrapping_sub())`)
636+
/// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
637637
///
638638
/// `count` is in units of T; e.g., a `count` of 3 represents a pointer
639639
/// offset of `3 * size_of::<T>()` bytes.

library/core/src/ptr/mut_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ impl<T: ?Sized> *mut T {
740740
}
741741

742742
/// Calculates the offset from a pointer using wrapping arithmetic.
743-
/// (convenience for `.wrapping_offset((count as isize).wrapping_sub())`)
743+
/// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
744744
///
745745
/// `count` is in units of T; e.g., a `count` of 3 represents a pointer
746746
/// offset of `3 * size_of::<T>()` bytes.

0 commit comments

Comments
 (0)