1111use core:: cmp:: Ordering ;
1212use core:: fmt:: Debug ;
1313use core:: hash:: { Hash , Hasher } ;
14- use core:: iter:: { FromIterator , Peekable } ;
14+ use core:: iter:: { FromIterator , Peekable , FusedIterator } ;
1515use core:: marker:: PhantomData ;
1616use core:: ops:: Index ;
1717use core:: { fmt, intrinsics, mem, ptr} ;
@@ -1147,6 +1147,9 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
11471147 }
11481148}
11491149
1150+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1151+ impl < ' a , K , V > FusedIterator for Iter < ' a , K , V > { }
1152+
11501153impl < ' a , K : ' a , V : ' a > DoubleEndedIterator for Iter < ' a , K , V > {
11511154 fn next_back ( & mut self ) -> Option < ( & ' a K , & ' a V ) > {
11521155 if self . length == 0 {
@@ -1216,6 +1219,9 @@ impl<'a, K: 'a, V: 'a> ExactSizeIterator for IterMut<'a, K, V> {
12161219 }
12171220}
12181221
1222+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1223+ impl < ' a , K , V > FusedIterator for IterMut < ' a , K , V > { }
1224+
12191225impl < K , V > IntoIterator for BTreeMap < K , V > {
12201226 type Item = ( K , V ) ;
12211227 type IntoIter = IntoIter < K , V > ;
@@ -1338,6 +1344,9 @@ impl<K, V> ExactSizeIterator for IntoIter<K, V> {
13381344 }
13391345}
13401346
1347+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1348+ impl < K , V > FusedIterator for IntoIter < K , V > { }
1349+
13411350impl < ' a , K , V > Iterator for Keys < ' a , K , V > {
13421351 type Item = & ' a K ;
13431352
@@ -1362,6 +1371,9 @@ impl<'a, K, V> ExactSizeIterator for Keys<'a, K, V> {
13621371 }
13631372}
13641373
1374+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1375+ impl < ' a , K , V > FusedIterator for Keys < ' a , K , V > { }
1376+
13651377impl < ' a , K , V > Clone for Keys < ' a , K , V > {
13661378 fn clone ( & self ) -> Keys < ' a , K , V > {
13671379 Keys { inner : self . inner . clone ( ) }
@@ -1392,6 +1404,9 @@ impl<'a, K, V> ExactSizeIterator for Values<'a, K, V> {
13921404 }
13931405}
13941406
1407+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1408+ impl < ' a , K , V > FusedIterator for Values < ' a , K , V > { }
1409+
13951410impl < ' a , K , V > Clone for Values < ' a , K , V > {
13961411 fn clone ( & self ) -> Values < ' a , K , V > {
13971412 Values { inner : self . inner . clone ( ) }
@@ -1437,6 +1452,10 @@ impl<'a, K, V> ExactSizeIterator for ValuesMut<'a, K, V> {
14371452 }
14381453}
14391454
1455+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1456+ impl < ' a , K , V > FusedIterator for ValuesMut < ' a , K , V > { }
1457+
1458+
14401459impl < ' a , K , V > Range < ' a , K , V > {
14411460 unsafe fn next_unchecked ( & mut self ) -> ( & ' a K , & ' a V ) {
14421461 let handle = self . front ;
@@ -1511,6 +1530,9 @@ impl<'a, K, V> Range<'a, K, V> {
15111530 }
15121531}
15131532
1533+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1534+ impl < ' a , K , V > FusedIterator for Range < ' a , K , V > { }
1535+
15141536impl < ' a , K , V > Clone for Range < ' a , K , V > {
15151537 fn clone ( & self ) -> Range < ' a , K , V > {
15161538 Range {
@@ -1574,6 +1596,9 @@ impl<'a, K, V> DoubleEndedIterator for RangeMut<'a, K, V> {
15741596 }
15751597}
15761598
1599+ #[ unstable( feature = "fused" , issue = "35602" ) ]
1600+ impl < ' a , K , V > FusedIterator for RangeMut < ' a , K , V > { }
1601+
15771602impl < ' a , K , V > RangeMut < ' a , K , V > {
15781603 unsafe fn next_back_unchecked ( & mut self ) -> ( & ' a K , & ' a mut V ) {
15791604 let handle = ptr:: read ( & self . back ) ;
0 commit comments