Skip to content

Commit b463871

Browse files
committed
(un)aligned
1 parent dc2237c commit b463871

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
748748
/// // Take a reference to a 32-bit integer which is not aligned.
749749
/// let unaligned = &mut x.unaligned as *mut u32;
750750
///
751-
/// // Dereferencing normally will emit an unaligned store instruction,
752-
/// // causing undefined behavior.
751+
/// // Dereferencing normally will emit an aligned store instruction,
752+
/// // causing undefined behavior because the pointer is not aligned.
753753
/// // *unaligned = v; // ERROR
754754
///
755755
/// // Instead, use `write_unaligned` to write improperly aligned values.

0 commit comments

Comments
 (0)