about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim (Theemathas) Chirananthavat <theemathas@gmail.com>2024-09-13 22:02:07 +0700
committerTim (Theemathas) Chirananthavat <theemathas@gmail.com>2024-09-13 22:02:07 +0700
commitf604ed631baa3428fcc8370402985a56fc0fc459 (patch)
tree4e894cb44184a50c891ebe8de6a82337978f74e6
parent6fa092a1024d6fc47926bb8eed9e2df075c2ff2f (diff)
downloadrust-f604ed631baa3428fcc8370402985a56fc0fc459.tar.gz
rust-f604ed631baa3428fcc8370402985a56fc0fc459.zip
Fix awkward wording.
-rw-r--r--library/core/src/mem/manually_drop.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/library/core/src/mem/manually_drop.rs b/library/core/src/mem/manually_drop.rs
index 24d95f93900..8dea3539e46 100644
--- a/library/core/src/mem/manually_drop.rs
+++ b/library/core/src/mem/manually_drop.rs
@@ -63,22 +63,21 @@ use crate::ptr;
 /// # Safety hazards when storing `ManuallyDrop` in a struct or an enum.
 ///
 /// Special care is needed when all of the conditions below are met:
-/// * A field of a struct or enum is a `ManuallyDrop` or contains a
-///   `ManuallyDrop`, without the `ManuallyDrop` being inside a `union`.
+/// * A struct or enum contains a `ManuallyDrop`.
+/// * The `ManuallyDrop` is not inside a `union`.
 /// * The struct or enum is part of public API, or is stored in a struct or an
 ///   enum that is part of public API.
-/// * There is code outside of a `Drop` implementation that calls
-///   [`ManuallyDrop::drop`] or [`ManuallyDrop::take`] on the `ManuallyDrop`
-///   field.
+/// * There is code that drops the contents of the `ManuallyDrop` field, and
+///   this code is outside the struct or enum's `Drop` implementation.
 ///
-/// In particular, the following hazards can occur:
+/// In particular, the following hazards may occur:
 ///
 /// #### Storing generic types
 ///
 /// If the `ManuallyDrop` contains a client-supplied generic type, the client
-/// might provide a `Box`, causing undefined behavior when the struct / enum is
-/// later moved, as mentioned above. For example, the following code causes
-/// undefined behavior:
+/// might provide a `Box` as that type. This would cause undefined behavior when
+/// the struct or enum is later moved, as mentioned in the previous section. For
+/// example, the following code causes undefined behavior:
 ///
 /// ```no_run
 /// use std::mem::ManuallyDrop;
@@ -114,7 +113,7 @@ use crate::ptr;
 /// #### Deriving traits
 ///
 /// Deriving `Debug`, `Clone`, `PartialEq`, `PartialOrd`, `Ord`, or `Hash` on
-/// the struct / enum could be unsound, since the derived implementations of
+/// the struct or enum could be unsound, since the derived implementations of
 /// these traits would access the `ManuallyDrop` field. For example, the
 /// following code causes undefined behavior:
 ///