From f502bf78cba8974cdfbd20f3b524d86b982e5e2b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 21 Jul 2019 12:08:19 +0200 Subject: [PATCH] sync with nomicon: raw ptr must be non-dangling and aligned every time it is dereferenced --- src/libstd/primitive_docs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 95b803e3461e..0f66e8cd47ea 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -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. ///