about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2023-08-16 19:50:05 +0000
committerGitHub <noreply@github.com>2023-08-16 19:50:05 +0000
commit6c6875d8ecb1df024920ab7a80aa70cf5b385ddc (patch)
treeccbbdc73bb94a2bbf8728b89dc65dc9e318f2e88 /library/alloc/src
parent5bf1bfd784f3143e383f77d42b5c04752fd473e7 (diff)
downloadrust-6c6875d8ecb1df024920ab7a80aa70cf5b385ddc.tar.gz
rust-6c6875d8ecb1df024920ab7a80aa70cf5b385ddc.zip
Update library/alloc/src/vec/mod.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/vec/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 6c238fd2d0c..2bf25b3e01c 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1249,7 +1249,8 @@ impl<T, A: Allocator> Vec<T, A> {
     ///     let _ = ptr1.read();
     ///     let ptr2 = v.as_mut_ptr().offset(2);
     ///     ptr2.write(2);
-    ///     // Notably, the write to `ptr2` did *not* invalidate `ptr1`:
+    ///     // Notably, the write to `ptr2` did *not* invalidate `ptr1`
+    ///     // because it mutated a different element:
     ///     let _ = ptr1.read();
     /// }
     /// ```