File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use crate::ops::{Deref, DerefMut};
2
2
use crate :: ptr;
3
3
4
4
/// A wrapper to inhibit compiler from automatically calling `T`’s destructor.
5
- ///
6
5
/// This wrapper is 0-cost.
7
6
///
8
7
/// `ManuallyDrop<T>` is subject to the same layout optimizations as `T`.
@@ -11,6 +10,11 @@ use crate::ptr;
11
10
/// with [`mem::zeroed`] is undefined behavior.
12
11
/// If you need to handle uninitialized data, use [`MaybeUninit<T>`] instead.
13
12
///
13
+ /// Note that accessing the value inside a `ManuallyDrop<T>` is safe.
14
+ /// This means that a `ManuallyDrop<T>` whose content has been dropped must not
15
+ /// be exposed through a public safe API.
16
+ /// Correspondingly, `ManuallyDrop::drop` is unsafe.
17
+ ///
14
18
/// # Examples
15
19
///
16
20
/// This wrapper can be used to enforce a particular drop order on fields, regardless
You can’t perform that action at this time.
0 commit comments