From 16754f92f0c38056a9efba6eafb76032c46527c4 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Thu, 28 Feb 2019 15:51:25 +0100 Subject: [PATCH] Fix copy_from_slice There is no guarantee that the slices are not overlapping. --- src/libcore/slice/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 2063f8ffaf65a..831c12156cfb5 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1968,7 +1968,7 @@ impl [T] { assert_eq!(self.len(), src.len(), "destination and source slices have different lengths"); unsafe { - ptr::copy_nonoverlapping( + ptr::copy( src.as_ptr(), self.as_mut_ptr(), self.len()); } }