Skip to content

Commit

Permalink
Rollup merge of rust-lang#81168 - soniasingla:doc/sonia, r=jonas-schi…
Browse files Browse the repository at this point in the history
…evink

Fixes rust-lang#81109 - Typo in pointer::wrapping_sub

Signed-off-by: soniasingla <soniasingla.1812@gmail.com>

Related to issue rust-lang#81109
  • Loading branch information
m-ou-se committed Jan 18, 2021
2 parents c3fcaf8 + 47c2476 commit 1ae90bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1ae90bd

Please sign in to comment.