about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-23 06:55:31 +0200
committerGitHub <noreply@github.com>2022-08-23 06:55:31 +0200
commit683a08af6a510c12c5df596de53046ba5afd2cfd (patch)
treef812ea83bd14af6c964f4befc96e261f6f0ca62c
parent234e0f27c22eb3ab21363574c755f3f5bc0d6795 (diff)
parent3d2b61c1af3442b24786e8152af75ae7cfdeae6a (diff)
downloadrust-683a08af6a510c12c5df596de53046ba5afd2cfd.tar.gz
rust-683a08af6a510c12c5df596de53046ba5afd2cfd.zip
Rollup merge of #100893 - thinety:master, r=scottmcm
Remove out-of-context comment in `mem::MaybeUninit` documentation

Reverted the comment to an earlier version to avoid confusion: neither raw pointer assignment nor `ptr::write` is used inside the for loop.
-rw-r--r--library/core/src/mem/maybe_uninit.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index b4ea5360833..997494c769e 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -130,11 +130,8 @@ use crate::slice;
 ///         MaybeUninit::uninit().assume_init()
 ///     };
 ///
-///     // Dropping a `MaybeUninit` does nothing. Thus using raw pointer
-///     // assignment instead of `ptr::write` does not cause the old
-///     // uninitialized value to be dropped. Also if there is a panic during
-///     // this loop, we have a memory leak, but there is no memory safety
-///     // issue.
+///     // Dropping a `MaybeUninit` does nothing, so if there is a panic during this loop,
+///     // we have a memory leak, but there is no memory safety issue.
 ///     for elem in &mut data[..] {
 ///         elem.write(vec![42]);
 ///     }