We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c06f551 commit 2741224Copy full SHA for 2741224
src/libcore/ptr.rs
@@ -149,7 +149,8 @@ pub use intrinsics::write_bytes;
149
/// assert!(weak.upgrade().is_none());
150
/// ```
151
///
152
-/// Drops a potentially unaligned value by copying it to aligned memory first:
+/// Unaligned values cannot be dropped in place, they must be copied to an aligned
153
+/// location first:
154
155
/// use std::ptr;
156
/// use std::mem;
@@ -158,7 +159,7 @@ pub use intrinsics::write_bytes;
158
159
/// let mut copy: T = mem::uninitialized();
160
/// let copy = &mut copy as *mut T;
161
/// ptr::copy(to_drop, copy, 1);
-/// ptr::drop_in_place(copy);
162
+/// drop(copy);
163
/// }
164
165
/// #[repr(packed, C)]
0 commit comments