rollup merge of #19483: cgaebel/copy_memory-comment

This commit is contained in:
Corey Richardson
2014-12-05 10:07:23 -08:00
+3 -2
View File
@@ -1781,12 +1781,13 @@ fn set_memory(&mut self, value: u8) {
/// 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(),