diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 8a1d14b48a1..da47ca50983 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1962,6 +1962,12 @@ impl Vec { } +/// Extend implementation that copies elements out of references before pushing them onto the Vec. +/// +/// This implementation is specialized for slice iterators, where it uses [`copy_from_slice`] to +/// append the entire slice at once. +/// +/// [`copy_from_slice`]: ../../std/primitive.slice.html#method.copy_from_slice #[stable(feature = "extend_ref", since = "1.2.0")] impl<'a, T: 'a + Copy> Extend<&'a T> for Vec { fn extend>(&mut self, iter: I) {