]> git.lizzy.rs Git - rust.git/commitdiff
sync with nomicon: raw ptr must be non-dangling and aligned every time it is dereferenced
authorRalf Jung <post@ralfj.de>
Sun, 21 Jul 2019 10:08:19 +0000 (12:08 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 21 Jul 2019 10:08:19 +0000 (12:08 +0200)
src/libstd/primitive_docs.rs

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