@@ -420,7 +420,7 @@ impl<T: ?Sized> *const T {
420420 unsafe { self . cast :: < u8 > ( ) . offset ( count) . with_metadata_of ( self ) }
421421 }
422422
423- /// Calculates the offset from a pointer using wrapping arithmetic.
423+ /// Adds a signed offset to a pointer using wrapping arithmetic.
424424 ///
425425 /// `count` is in units of T; e.g., a `count` of 3 represents a pointer
426426 /// offset of `3 * size_of::<T>()` bytes.
@@ -482,7 +482,7 @@ impl<T: ?Sized> *const T {
482482 unsafe { intrinsics:: arith_offset ( self , count) }
483483 }
484484
485- /// Calculates the offset from a pointer in bytes using wrapping arithmetic.
485+ /// Adds a signed offset in bytes to a pointer using wrapping arithmetic.
486486 ///
487487 /// `count` is in units of **bytes**.
488488 ///
@@ -972,8 +972,7 @@ impl<T: ?Sized> *const T {
972972 unsafe { self . cast :: < u8 > ( ) . sub ( count) . with_metadata_of ( self ) }
973973 }
974974
975- /// Calculates the offset from a pointer using wrapping arithmetic.
976- /// (convenience for `.wrapping_offset(count as isize)`)
975+ /// Adds an unsigned offset to a pointer using wrapping arithmetic.
977976 ///
978977 /// `count` is in units of T; e.g., a `count` of 3 represents a pointer
979978 /// offset of `3 * size_of::<T>()` bytes.
@@ -1034,8 +1033,7 @@ impl<T: ?Sized> *const T {
10341033 self . wrapping_offset ( count as isize )
10351034 }
10361035
1037- /// Calculates the offset from a pointer in bytes using wrapping arithmetic.
1038- /// (convenience for `.wrapping_byte_offset(count as isize)`)
1036+ /// Adds an unsigned offset in bytes to a pointer using wrapping arithmetic.
10391037 ///
10401038 /// `count` is in units of bytes.
10411039 ///
@@ -1053,8 +1051,7 @@ impl<T: ?Sized> *const T {
10531051 self . cast :: < u8 > ( ) . wrapping_add ( count) . with_metadata_of ( self )
10541052 }
10551053
1056- /// Calculates the offset from a pointer using wrapping arithmetic.
1057- /// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
1054+ /// Subtracts an unsigned offset from a pointer using wrapping arithmetic.
10581055 ///
10591056 /// `count` is in units of T; e.g., a `count` of 3 represents a pointer
10601057 /// offset of `3 * size_of::<T>()` bytes.
@@ -1115,8 +1112,7 @@ impl<T: ?Sized> *const T {
11151112 self . wrapping_offset ( ( count as isize ) . wrapping_neg ( ) )
11161113 }
11171114
1118- /// Calculates the offset from a pointer in bytes using wrapping arithmetic.
1119- /// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
1115+ /// Subtracts an unsigned offset in bytes from a pointer using wrapping arithmetic.
11201116 ///
11211117 /// `count` is in units of bytes.
11221118 ///
0 commit comments