Skip to content

Commit d801a4d

Browse files
committed
Fallout: iter, add markers or other changes such that all type parameters are used.
1 parent 1735e41 commit d801a4d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/libcore/iter.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ use clone::Clone;
6262
use cmp;
6363
use cmp::Ord;
6464
use default::Default;
65+
use marker;
6566
use mem;
6667
use num::{ToPrimitive, Int};
6768
use ops::{Add, Deref, FnMut};
@@ -947,7 +948,7 @@ pub trait IteratorExt: Iterator + Sized {
947948
FromB: Default + Extend<B>,
948949
Self: Iterator<Item=(A, B)>,
949950
{
950-
struct SizeHint<A>(usize, Option<usize>);
951+
struct SizeHint<A>(usize, Option<usize>, marker::PhantomData<A>);
951952
impl<A> Iterator for SizeHint<A> {
952953
type Item = A;
953954

@@ -961,8 +962,8 @@ pub trait IteratorExt: Iterator + Sized {
961962
let mut ts: FromA = Default::default();
962963
let mut us: FromB = Default::default();
963964

964-
ts.extend(SizeHint(lo, hi));
965-
us.extend(SizeHint(lo, hi));
965+
ts.extend(SizeHint(lo, hi, marker::PhantomData));
966+
us.extend(SizeHint(lo, hi, marker::PhantomData));
966967

967968
for (t, u) in self {
968969
ts.extend(Some(t).into_iter());
@@ -2047,8 +2048,8 @@ pub struct Scan<I, St, F> {
20472048
}
20482049

20492050
#[stable(feature = "rust1", since = "1.0.0")]
2050-
impl<B, I: Iterator, St, F> Iterator for Scan<I, St, F> where
2051-
F: FnMut(&mut St, I::Item) -> Option<B>,
2051+
impl<A, B, I: Iterator<Item=A>, St, F> Iterator for Scan<I, St, F> where
2052+
F: FnMut(&mut St, A) -> Option<B>,
20522053
{
20532054
type Item = B;
20542055

0 commit comments

Comments
 (0)