File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -436,9 +436,9 @@ impl CString {
436
436
///
437
437
/// unsafe {
438
438
/// assert_eq!(b'f', *ptr as u8);
439
- /// assert_eq!(b'o', *ptr.offset (1) as u8);
440
- /// assert_eq!(b'o', *ptr.offset (2) as u8);
441
- /// assert_eq!(b'\0', *ptr.offset (3) as u8);
439
+ /// assert_eq!(b'o', *ptr.add (1) as u8);
440
+ /// assert_eq!(b'o', *ptr.add (2) as u8);
441
+ /// assert_eq!(b'\0', *ptr.add (3) as u8);
442
442
///
443
443
/// // retake pointer to free memory
444
444
/// let _ = CString::from_raw(ptr);
Original file line number Diff line number Diff line change @@ -2905,7 +2905,7 @@ impl<T> [T] {
2905
2905
// `prev_ptr_write` is never less than 0 and is inside the slice.
2906
2906
// This fulfils the requirements for dereferencing `ptr_read`, `prev_ptr_write`
2907
2907
// and `ptr_write`, and for using `ptr.add(next_read)`, `ptr.add(next_write - 1)`
2908
- // and `prev_ptr_write.offset (1)`.
2908
+ // and `prev_ptr_write.add (1)`.
2909
2909
//
2910
2910
// `next_write` is also incremented at most once per loop at most meaning
2911
2911
// no element is skipped when it may need to be swapped.
Original file line number Diff line number Diff line change @@ -1555,7 +1555,7 @@ impl<T> AtomicPtr<T> {
1555
1555
/// previous pointer.
1556
1556
///
1557
1557
/// This is equivalent to using [`wrapping_add`] and [`cast`] to atomically
1558
- /// perform `ptr = ptr.cast::<u8>().wrapping_add( val).cast::<T>( )`.
1558
+ /// perform `ptr = ptr.wrapping_byte_add( val)`.
1559
1559
///
1560
1560
/// `fetch_byte_add` takes an [`Ordering`] argument which describes the
1561
1561
/// memory ordering of this operation. All ordering modes are possible. Note
@@ -1592,7 +1592,7 @@ impl<T> AtomicPtr<T> {
1592
1592
/// previous pointer.
1593
1593
///
1594
1594
/// This is equivalent to using [`wrapping_sub`] and [`cast`] to atomically
1595
- /// perform `ptr = ptr.cast::<u8>().wrapping_sub( val).cast::<T>( )`.
1595
+ /// perform `ptr = ptr.wrapping_byte_sub( val)`.
1596
1596
///
1597
1597
/// `fetch_byte_sub` takes an [`Ordering`] argument which describes the
1598
1598
/// memory ordering of this operation. All ordering modes are possible. Note
You can’t perform that action at this time.
0 commit comments