Update library/alloc/src/vec/mod.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
Manish Goregaokar 2023-08-16 19:50:05 +00:00 committed by GitHub
parent 5bf1bfd784
commit 6c6875d8ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
/// }
/// ```