about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2018-05-28 08:36:14 -0400
committerCorey Farwell <coreyf@rwell.org>2018-06-01 23:08:12 -0400
commit61b5bd25b528853f1b3064bbba3328a3360e8101 (patch)
tree967f1a420e93ab2672944d8671ca692dfa9b0e04
parent68e0e58df7669d548861751e9f710f85dfc39958 (diff)
downloadrust-61b5bd25b528853f1b3064bbba3328a3360e8101.tar.gz
rust-61b5bd25b528853f1b3064bbba3328a3360e8101.zip
Reword {ptr,mem}::replace docs.
Fixes https://github.com/rust-lang/rust/issues/50657.
-rw-r--r--src/libcore/mem.rs5
-rw-r--r--src/libcore/ptr.rs5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index 059c099d66b..e4e3b1c2a3a 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -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
 ///
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index 6c0709caa08..39315d8f0c8 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -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
 ///