diff options
| author | soniasingla <soniasingla.1812@gmail.com> | 2021-01-18 20:31:47 +0530 |
|---|---|---|
| committer | soniasingla <soniasingla.1812@gmail.com> | 2021-01-18 20:31:47 +0530 |
| commit | 47c2476c689577d14e271c0d85578fb82417552c (patch) | |
| tree | 47fc37ee94eec522284ace18ad1fe31feefccf1b | |
| parent | 86e0ff47a0d1afcbe9f0c8cdb54f60bb18da20df (diff) | |
| download | rust-47c2476c689577d14e271c0d85578fb82417552c.tar.gz rust-47c2476c689577d14e271c0d85578fb82417552c.zip | |
Fixes #81109 - Typo in pointer::wrapping_sub
Signed-off-by: soniasingla <soniasingla.1812@gmail.com>
| -rw-r--r-- | library/core/src/ptr/const_ptr.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ptr/mut_ptr.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 66300116786..28de28c70e4 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -633,7 +633,7 @@ impl<T: ?Sized> *const T { } /// Calculates the offset from a pointer using wrapping arithmetic. - /// (convenience for `.wrapping_offset((count as isize).wrapping_sub())`) + /// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`) /// /// `count` is in units of T; e.g., a `count` of 3 represents a pointer /// offset of `3 * size_of::<T>()` bytes. diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index 785bf70c299..99744fc7112 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -740,7 +740,7 @@ impl<T: ?Sized> *mut T { } /// Calculates the offset from a pointer using wrapping arithmetic. - /// (convenience for `.wrapping_offset((count as isize).wrapping_sub())`) + /// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`) /// /// `count` is in units of T; e.g., a `count` of 3 represents a pointer /// offset of `3 * size_of::<T>()` bytes. |
