From 851c7b5e0f76e32e5a1316befc7465bdc573ac43 Mon Sep 17 00:00:00 2001 From: Clark Gaebel Date: Tue, 2 Dec 2014 17:32:37 -0800 Subject: [PATCH] Fixed out of date comment on `copy_memory` --- src/libcore/slice.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 950f04a5d97e3..906cbd72104e9 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(),