]> git.lizzy.rs Git - rust.git/commitdiff
Fix copy_from_slice which should be extend_from_slice
authorMarkus Westerlind <markus.westerlind@imperva.com>
Thu, 9 Jan 2020 06:45:29 +0000 (07:45 +0100)
committerMarkus Westerlind <markus.westerlind@imperva.com>
Thu, 9 Jan 2020 06:45:29 +0000 (07:45 +0100)
src/librustc/ty/structural_impls.rs

index 385c8eeb4b83c5230be1b2da68797ec212f42417..783164d2806c1e77d9c001dc7559e2313d91a8b3 100644 (file)
@@ -1078,7 +1078,7 @@ fn fold_list<'tcx, F, T>(
     }) {
         // An element changed, prepare to intern the resulting list
         let mut new_list = SmallVec::<[_; 8]>::with_capacity(list.len());
-        new_list.copy_from_slice(&list[..i]);
+        new_list.extend_from_slice(&list[..i]);
         new_list.push(new_t);
         new_list.extend(iter.map(|t| t.fold_with(folder)));
         intern(folder.tcx(), &new_list)