about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorClark Gaebel <cgaebel@mozilla.com>2014-12-02 17:32:37 -0800
committerClark Gaebel <cgaebel@mozilla.com>2014-12-02 17:50:26 -0800
commit851c7b5e0f76e32e5a1316befc7465bdc573ac43 (patch)
treed01298f02499545666694418e99e8b4e687465cf /src/libcore
parent3a325c666d2cb7e297bf3057ff2442f96a79428b (diff)
downloadrust-851c7b5e0f76e32e5a1316befc7465bdc573ac43.tar.gz
rust-851c7b5e0f76e32e5a1316befc7465bdc573ac43.zip
Fixed out of date comment on `copy_memory`
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/slice.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index 950f04a5d97..906cbd72104 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -1781,12 +1781,13 @@ pub mod bytes {
 
     /// Copies data from `src` to `dst`
     ///
-    /// `src` and `dst` must not overlap. Panics if the length of `dst`
-    /// is less than the length of `src`.
+    /// Panics if the length of `dst` is less than the length of `src`.
     #[inline]
     pub fn copy_memory(dst: &mut [u8], src: &[u8]) {
         let len_src = src.len();
         assert!(dst.len() >= len_src);
+        // `dst` is unaliasable, so we know statically it doesn't overlap
+        // with `src`.
         unsafe {
             ptr::copy_nonoverlapping_memory(dst.as_mut_ptr(),
                                             src.as_ptr(),