Skip to content

Commit

Permalink
Reword {ptr,mem}::replace docs.
Browse files Browse the repository at this point in the history
Fixes #50657.
  • Loading branch information
frewsxcv committed Jun 2, 2018
1 parent 68e0e58 commit 61b5bd2
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
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
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 61b5bd2

Please sign in to comment.