Skip to content

Commit

Permalink
Rollup merge of rust-lang#40333 - tbu-:pr_doc_ptr_write, r=alexcrichton
Browse files Browse the repository at this point in the history
Clarify handling of `src` in `ptr::write`

Fixes rust-lang#39733.
  • Loading branch information
frewsxcv authored Mar 8, 2017
2 parents 1c47e16 + 025bf95 commit c4cb6bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ 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.
///
/// This is appropriate for initializing uninitialized memory, or overwriting
/// memory that has previously been `read` from.
///
Expand Down

0 comments on commit c4cb6bf

Please sign in to comment.