Rollup merge of #51124 - frewsxcv:frewsxcv-replace, r=QuietMisdreavus

Reword {ptr,mem}::replace docs.

Fixes https://github.com/rust-lang/rust/issues/50657.
This commit is contained in:
Mark Simulacrum 2018-06-02 13:14:24 -06:00 committed by GitHub
commit dd61a32459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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
///

View File

@ -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
///