From 13341f4c6b6fa470a97781703ac6fe356e307194 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Thu, 9 Mar 2017 13:45:52 +0100 Subject: [PATCH] Reword the non-dropping of `src` for `ptr::write{,_unaligned}` --- src/libcore/ptr.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 260fdab9d58fb..0b7aa4fa9117c 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -191,9 +191,8 @@ pub unsafe fn read_unaligned(src: *const T) -> T { /// allocations or resources, so care must be taken not to overwrite an object /// that should be dropped. /// -/// It does not immediately drop the contents of `src` either; it is rather -/// *moved* into the memory location `dst` and will be dropped whenever that -/// location goes out of scope. +/// Additionally, it does not drop `src`. Semantically, `src` is moved into the +/// location pointed to by `dst`. /// /// This is appropriate for initializing uninitialized memory, or overwriting /// memory that has previously been `read` from. @@ -233,6 +232,9 @@ pub unsafe fn write(dst: *mut T, src: T) { /// allocations or resources, so care must be taken not to overwrite an object /// that should be dropped. /// +/// Additionally, it does not drop `src`. Semantically, `src` is moved into the +/// location pointed to by `dst`. +/// /// This is appropriate for initializing uninitialized memory, or overwriting /// memory that has previously been `read` from. ///