diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index a5caf2522c8f4..29878851da5ce 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -2297,6 +2297,15 @@ where } } +impl SpecExtend> for Vec { + fn spec_extend(&mut self, mut iterator: IntoIter) { + unsafe { + self.append_elements(iterator.as_slice() as _); + } + iterator.ptr = iterator.end; + } +} + impl<'a, T: 'a, I> SpecExtend<&'a T, I> for Vec where I: Iterator,