@@ -1193,6 +1193,11 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
11931193 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
11941194 ( self . length , Some ( self . length ) )
11951195 }
1196+
1197+ #[ inline]
1198+ fn last ( mut self ) -> Option < ( & ' a K , & ' a V ) > {
1199+ self . next_back ( )
1200+ }
11961201}
11971202
11981203#[ stable( feature = "fused" , since = "1.26.0" ) ]
@@ -1253,6 +1258,11 @@ impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
12531258 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
12541259 ( self . length , Some ( self . length ) )
12551260 }
1261+
1262+ #[ inline]
1263+ fn last ( mut self ) -> Option < ( & ' a K , & ' a mut V ) > {
1264+ self . next_back ( )
1265+ }
12561266}
12571267
12581268#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -1359,6 +1369,11 @@ impl<K, V> Iterator for IntoIter<K, V> {
13591369 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
13601370 ( self . length , Some ( self . length ) )
13611371 }
1372+
1373+ #[ inline]
1374+ fn last ( mut self ) -> Option < ( K , V ) > {
1375+ self . next_back ( )
1376+ }
13621377}
13631378
13641379#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -1421,6 +1436,11 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
14211436 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
14221437 self . inner . size_hint ( )
14231438 }
1439+
1440+ #[ inline]
1441+ fn last ( mut self ) -> Option < & ' a K > {
1442+ self . next_back ( )
1443+ }
14241444}
14251445
14261446#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -1458,6 +1478,11 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
14581478 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
14591479 self . inner . size_hint ( )
14601480 }
1481+
1482+ #[ inline]
1483+ fn last ( mut self ) -> Option < & ' a V > {
1484+ self . next_back ( )
1485+ }
14611486}
14621487
14631488#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -1495,6 +1520,11 @@ impl<'a, K, V> Iterator for Range<'a, K, V> {
14951520 unsafe { Some ( self . next_unchecked ( ) ) }
14961521 }
14971522 }
1523+
1524+ #[ inline]
1525+ fn last ( mut self ) -> Option < ( & ' a K , & ' a V ) > {
1526+ self . next_back ( )
1527+ }
14981528}
14991529
15001530#[ stable( feature = "map_values_mut" , since = "1.10.0" ) ]
@@ -1508,6 +1538,11 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
15081538 fn size_hint ( & self ) -> ( usize , Option < usize > ) {
15091539 self . inner . size_hint ( )
15101540 }
1541+
1542+ #[ inline]
1543+ fn last ( mut self ) -> Option < & ' a mut V > {
1544+ self . next_back ( )
1545+ }
15111546}
15121547
15131548#[ stable( feature = "map_values_mut" , since = "1.10.0" ) ]
@@ -1626,6 +1661,11 @@ impl<'a, K, V> Iterator for RangeMut<'a, K, V> {
16261661 unsafe { Some ( self . next_unchecked ( ) ) }
16271662 }
16281663 }
1664+
1665+ #[ inline]
1666+ fn last ( mut self ) -> Option < ( & ' a K , & ' a mut V ) > {
1667+ self . next_back ( )
1668+ }
16291669}
16301670
16311671impl < ' a , K , V > RangeMut < ' a , K , V > {
0 commit comments