Skip to content

Commit 0955f1f

Browse files
gonzalobghkBst
andauthored
Apply suggestions from code review
Co-authored-by: Marijn Schouten <hkBst@users.noreply.github.com>
1 parent e8f7cc9 commit 0955f1f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

library/core/src/ptr/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,10 +2166,9 @@ pub unsafe fn write_volatile<T>(dst: *mut T, src: T) {
21662166
}
21672167
}
21682168

2169-
/// Calculate an offset to pointer `p` that aligns it up to alignment `a`.
2169+
/// Calculate an element-offset that increases a pointer's alignment.
21702170
///
2171-
/// Calculate offset (in terms of elements of `size_of::<T>()` stride) that has to be added
2172-
/// to pointer `p` so that pointer `p` would get aligned up to `a`.
2171+
/// Calculate an element-offset (not byte-offset) that when added to a given pointer `p`, increases `p`'s alignment to at least the given alignment `a`.
21732172
///
21742173
/// # Safety
21752174
/// `a` must be a power of two.

0 commit comments

Comments
 (0)