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.
src
ptr::write
1 parent b04ebef commit 025bf95Copy full SHA for 025bf95
src/libcore/ptr.rs
@@ -191,6 +191,10 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
191
/// allocations or resources, so care must be taken not to overwrite an object
192
/// that should be dropped.
193
///
194
+/// It does not immediately drop the contents of `src` either; it is rather
195
+/// *moved* into the memory location `dst` and will be dropped whenever that
196
+/// location goes out of scope.
197
+///
198
/// This is appropriate for initializing uninitialized memory, or overwriting
199
/// memory that has previously been `read` from.
200
0 commit comments