Rollup merge of #40387 - tbu-:pr_doc_ptr_write2, r=steveklabnik

Reword the non-dropping of `src` for `ptr::write{,_unaligned}`

@niconii Is it OK if I put your wording into the documentation?
CC @nagisa
This commit is contained in:
Corey Farwell 2017-03-17 08:48:48 -04:00 committed by GitHub
commit 70e7327b4e
1 changed files with 5 additions and 3 deletions

View File

@ -191,9 +191,8 @@ pub unsafe fn read_unaligned<T>(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<T>(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.
///