Skip to content

Commit f502bf7

Browse files
committed
sync with nomicon: raw ptr must be non-dangling and aligned every time it is dereferenced
1 parent 2e6b13a commit f502bf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/primitive_docs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ mod prim_unit { }
363363
/// *[See also the `std::ptr` module](ptr/index.html).*
364364
///
365365
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
366-
/// Raw pointers can be unaligned or null when unused. However, when a raw pointer is used to
367-
/// load/store data from/to memory, they must be non-null and aligned.
366+
/// Raw pointers can be unaligned or null when unused. However, when a raw pointer is
367+
/// dereferenced (using the `*` operator), it must be non-null and aligned.
368368
/// Storing through a raw pointer (`*ptr = data`) calls `drop` on the old value, so
369369
/// [`write`] must be used if memory is not already initialized.
370370
///

0 commit comments

Comments
 (0)