Skip to content

Commit

Permalink
Use turbofish for size_of<T> and align_of<T> in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thaliaarchi committed Mar 5, 2025
1 parent 77f8c40 commit 4f07a0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ impl<T: ?Sized> *const T {
unsafe { read_unaligned(self) }
}

/// Copies `count * size_of<T>` bytes from `self` to `dest`. The source
/// Copies `count * size_of::<T>()` bytes from `self` to `dest`. The source
/// and destination may overlap.
///
/// NOTE: this has the *same* argument order as [`ptr::copy`].
Expand All @@ -1333,7 +1333,7 @@ impl<T: ?Sized> *const T {
unsafe { copy(self, dest, count) }
}

/// Copies `count * size_of<T>` bytes from `self` to `dest`. The source
/// Copies `count * size_of::<T>()` bytes from `self` to `dest`. The source
/// and destination may *not* overlap.
///
/// NOTE: this has the *same* argument order as [`ptr::copy_nonoverlapping`].
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ impl<T: ?Sized> *mut T {
unsafe { read_unaligned(self) }
}

/// Copies `count * size_of<T>` bytes from `self` to `dest`. The source
/// Copies `count * size_of::<T>()` bytes from `self` to `dest`. The source
/// and destination may overlap.
///
/// NOTE: this has the *same* argument order as [`ptr::copy`].
Expand All @@ -1417,7 +1417,7 @@ impl<T: ?Sized> *mut T {
unsafe { copy(self, dest, count) }
}

/// Copies `count * size_of<T>` bytes from `self` to `dest`. The source
/// Copies `count * size_of::<T>()` bytes from `self` to `dest`. The source
/// and destination may *not* overlap.
///
/// NOTE: this has the *same* argument order as [`ptr::copy_nonoverlapping`].
Expand All @@ -1437,7 +1437,7 @@ impl<T: ?Sized> *mut T {
unsafe { copy_nonoverlapping(self, dest, count) }
}

/// Copies `count * size_of<T>` bytes from `src` to `self`. The source
/// Copies `count * size_of::<T>()` bytes from `src` to `self`. The source
/// and destination may overlap.
///
/// NOTE: this has the *opposite* argument order of [`ptr::copy`].
Expand All @@ -1457,7 +1457,7 @@ impl<T: ?Sized> *mut T {
unsafe { copy(src, self, count) }
}

/// Copies `count * size_of<T>` bytes from `src` to `self`. The source
/// Copies `count * size_of::<T>()` bytes from `src` to `self`. The source
/// and destination may *not* overlap.
///
/// NOTE: this has the *opposite* argument order of [`ptr::copy_nonoverlapping`].
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { ptr::read_unaligned(self.as_ptr()) }
}

/// Copies `count * size_of<T>` bytes from `self` to `dest`. The source
/// Copies `count * size_of::<T>()` bytes from `self` to `dest`. The source
/// and destination may overlap.
///
/// NOTE: this has the *same* argument order as [`ptr::copy`].
Expand All @@ -1008,7 +1008,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { ptr::copy(self.as_ptr(), dest.as_ptr(), count) }
}

/// Copies `count * size_of<T>` bytes from `self` to `dest`. The source
/// Copies `count * size_of::<T>()` bytes from `self` to `dest`. The source
/// and destination may *not* overlap.
///
/// NOTE: this has the *same* argument order as [`ptr::copy_nonoverlapping`].
Expand All @@ -1028,7 +1028,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { ptr::copy_nonoverlapping(self.as_ptr(), dest.as_ptr(), count) }
}

/// Copies `count * size_of<T>` bytes from `src` to `self`. The source
/// Copies `count * size_of::<T>()` bytes from `src` to `self`. The source
/// and destination may overlap.
///
/// NOTE: this has the *opposite* argument order of [`ptr::copy`].
Expand All @@ -1048,7 +1048,7 @@ impl<T: ?Sized> NonNull<T> {
unsafe { ptr::copy(src.as_ptr(), self.as_ptr(), count) }
}

/// Copies `count * size_of<T>` bytes from `src` to `self`. The source
/// Copies `count * size_of::<T>()` bytes from `src` to `self`. The source
/// and destination may *not* overlap.
///
/// NOTE: this has the *opposite* argument order of [`ptr::copy_nonoverlapping`].
Expand Down

0 comments on commit 4f07a0b

Please sign in to comment.