diff options
| author | bors <bors@rust-lang.org> | 2016-06-21 02:18:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-21 02:18:42 -0700 |
| commit | fe96928d7de991e527a7ed7b88bb30aa965c8a08 (patch) | |
| tree | 6c303e57ad7547c76a5fbfee7432be81accc8a9b | |
| parent | 45cde975cb9b5f3ebe1261b5a962c75731e884e4 (diff) | |
| parent | 02f9be8524ac6e9706867e2ae0abd09bee95dc53 (diff) | |
| download | rust-fe96928d7de991e527a7ed7b88bb30aa965c8a08.tar.gz rust-fe96928d7de991e527a7ed7b88bb30aa965c8a08.zip | |
Auto merge of #34155 - ollie27:unzip, r=alexcrichton
Remove unzip() SizeHint hack This was using an invalid iterator so is likely to end with buggy behaviour. It also doesn't even benefit many type in std including Vec so removing it shouldn't cause any problems. Fixes: #33468
| -rw-r--r-- | src/libcore/iter/iterator.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 8fb71295a88..6f5bb2747df 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -11,7 +11,6 @@ use clone::Clone; use cmp::{Ord, PartialOrd, PartialEq, Ordering}; use default::Default; -use marker; use num::{Zero, One}; use ops::{Add, FnMut, Mul}; use option::Option::{self, Some, None}; @@ -1748,23 +1747,9 @@ pub trait Iterator { FromB: Default + Extend<B>, Self: Sized + Iterator<Item=(A, B)>, { - struct SizeHint<A>(usize, Option<usize>, marker::PhantomData<A>); - impl<A> Iterator for SizeHint<A> { - type Item = A; - - fn next(&mut self) -> Option<A> { None } - fn size_hint(&self) -> (usize, Option<usize>) { - (self.0, self.1) - } - } - - let (lo, hi) = self.size_hint(); let mut ts: FromA = Default::default(); let mut us: FromB = Default::default(); - ts.extend(SizeHint(lo, hi, marker::PhantomData)); - us.extend(SizeHint(lo, hi, marker::PhantomData)); - for (t, u) in self { ts.extend(Some(t)); us.extend(Some(u)); |
