diff options
| author | The8472 <git@infinite-source.de> | 2019-11-17 12:49:18 +0100 |
|---|---|---|
| committer | The8472 <git@infinite-source.de> | 2020-09-03 20:59:11 +0200 |
| commit | 631543dcb4e79d3c134a7dfc8e87b62287e96796 (patch) | |
| tree | 6aec12873e134a944cee381765a9841a28738fa6 /library/alloc/src | |
| parent | 07a8c1b95ad23a0d08bffce2613eb36cd0be8400 (diff) | |
| download | rust-631543dcb4e79d3c134a7dfc8e87b62287e96796.tar.gz rust-631543dcb4e79d3c134a7dfc8e87b62287e96796.zip | |
restore Vec::extend specialization for vec::IntoIter sources that
was lost during refactoring
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/vec.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index a5caf2522c8..29878851da5 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -2297,6 +2297,15 @@ where } } +impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> { + fn spec_extend(&mut self, mut iterator: IntoIter<T>) { + unsafe { + self.append_elements(iterator.as_slice() as _); + } + iterator.ptr = iterator.end; + } +} + impl<'a, T: 'a, I> SpecExtend<&'a T, I> for Vec<T> where I: Iterator<Item = &'a T>, |
