@@ -333,25 +333,6 @@ mod range;
333
333
mod sources;
334
334
mod traits;
335
335
336
- // All adaptors that preserve the size of the wrapped iterator are fine
337
- // Adaptors that may overflow in `size_hint` are not, i.e. `Chain`.
338
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
339
- impl < I > ExactSizeIterator for Enumerate < I > where I : ExactSizeIterator { }
340
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
341
- impl < I : ExactSizeIterator , F > ExactSizeIterator for Inspect < I , F > where
342
- F : FnMut ( & I :: Item ) ,
343
- { }
344
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
345
- impl < I > ExactSizeIterator for Rev < I >
346
- where I : ExactSizeIterator + DoubleEndedIterator { }
347
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
348
- impl < B , I : ExactSizeIterator , F > ExactSizeIterator for Map < I , F > where
349
- F : FnMut ( I :: Item ) -> B ,
350
- { }
351
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
352
- impl < A , B > ExactSizeIterator for Zip < A , B >
353
- where A : ExactSizeIterator , B : ExactSizeIterator { }
354
-
355
336
/// An double-ended iterator with the direction inverted.
356
337
///
357
338
/// This `struct` is created by the [`rev()`] method on [`Iterator`]. See its
@@ -382,6 +363,10 @@ impl<I> DoubleEndedIterator for Rev<I> where I: DoubleEndedIterator {
382
363
fn next_back ( & mut self ) -> Option < <I as Iterator >:: Item > { self . iter . next ( ) }
383
364
}
384
365
366
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
367
+ impl < I > ExactSizeIterator for Rev < I >
368
+ where I : ExactSizeIterator + DoubleEndedIterator { }
369
+
385
370
/// An iterator that clones the elements of an underlying iterator.
386
371
///
387
372
/// This `struct` is created by the [`cloned()`] method on [`Iterator`]. See its
@@ -679,6 +664,10 @@ impl<A, B> DoubleEndedIterator for Zip<A, B> where
679
664
}
680
665
}
681
666
667
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
668
+ impl < A , B > ExactSizeIterator for Zip < A , B >
669
+ where A : ExactSizeIterator , B : ExactSizeIterator { }
670
+
682
671
/// An iterator that maps the values of `iter` with `f`.
683
672
///
684
673
/// This `struct` is created by the [`map()`] method on [`Iterator`]. See its
@@ -771,6 +760,10 @@ impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for Map<I, F> where
771
760
}
772
761
}
773
762
763
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
764
+ impl < B , I : ExactSizeIterator , F > ExactSizeIterator for Map < I , F >
765
+ where F : FnMut ( I :: Item ) -> B { }
766
+
774
767
/// An iterator that filters the elements of `iter` with `predicate`.
775
768
///
776
769
/// This `struct` is created by the [`filter()`] method on [`Iterator`]. See its
@@ -966,6 +959,9 @@ impl<I> DoubleEndedIterator for Enumerate<I> where
966
959
}
967
960
}
968
961
962
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
963
+ impl < I > ExactSizeIterator for Enumerate < I > where I : ExactSizeIterator { }
964
+
969
965
/// An iterator with a `peek()` that returns an optional reference to the next
970
966
/// element.
971
967
///
@@ -1655,3 +1651,7 @@ impl<I: DoubleEndedIterator, F> DoubleEndedIterator for Inspect<I, F>
1655
1651
self . do_inspect ( next)
1656
1652
}
1657
1653
}
1654
+
1655
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1656
+ impl < I : ExactSizeIterator , F > ExactSizeIterator for Inspect < I , F >
1657
+ where F : FnMut ( & I :: Item ) { }
0 commit comments