Skip to content

Commit

Permalink
Rollup merge of rust-lang#51124 - frewsxcv:frewsxcv-replace, r=QuietM…
Browse files Browse the repository at this point in the history
…isdreavus

Reword {ptr,mem}::replace docs.

Fixes rust-lang#50657.
  • Loading branch information
Mark-Simulacrum committed Jun 2, 2018
2 parents 6ff9108 + 61b5bd2 commit dd61a32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,9 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
}
}

/// Replaces the value at a mutable location with a new one, returning the old value, without
/// deinitializing either one.
/// Moves `src` into the referenced `dest`, returning the previous `dest` value.
///
/// Neither value is dropped.
///
/// # Examples
///
Expand Down
5 changes: 3 additions & 2 deletions src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
}
}

/// Replaces the value at `dest` with `src`, returning the old
/// value, without dropping either.
/// Moves `src` into the pointed `dest`, returning the previous `dest` value.
///
/// Neither value is dropped.
///
/// # Safety
///
Expand Down

0 comments on commit dd61a32

Please sign in to comment.