Skip to content

Commit

Permalink
Reword the non-dropping of src for ptr::write{,_unaligned}
Browse files Browse the repository at this point in the history
  • Loading branch information
tbu- committed Mar 9, 2017
1 parent 3087a1f commit 13341f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 13341f4

Please sign in to comment.