@@ -1407,6 +1407,14 @@ impl<K, V> Clone for Iter<'_, K, V> {
14071407 }
14081408}
14091409
1410+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1411+ impl < K , V > Default for Iter < ' _ , K , V > {
1412+ #[ inline]
1413+ fn default ( ) -> Self {
1414+ Iter { base : Default :: default ( ) }
1415+ }
1416+ }
1417+
14101418#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
14111419impl < K : Debug , V : Debug > fmt:: Debug for Iter < ' _ , K , V > {
14121420 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1445,6 +1453,14 @@ impl<'a, K, V> IterMut<'a, K, V> {
14451453 }
14461454}
14471455
1456+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1457+ impl < K , V > Default for IterMut < ' _ , K , V > {
1458+ #[ inline]
1459+ fn default ( ) -> Self {
1460+ IterMut { base : Default :: default ( ) }
1461+ }
1462+ }
1463+
14481464/// An owning iterator over the entries of a `HashMap`.
14491465///
14501466/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
@@ -1475,6 +1491,14 @@ impl<K, V> IntoIter<K, V> {
14751491 }
14761492}
14771493
1494+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1495+ impl < K , V > Default for IntoIter < K , V > {
1496+ #[ inline]
1497+ fn default ( ) -> Self {
1498+ IntoIter { base : Default :: default ( ) }
1499+ }
1500+ }
1501+
14781502/// An iterator over the keys of a `HashMap`.
14791503///
14801504/// This `struct` is created by the [`keys`] method on [`HashMap`]. See its
@@ -1507,6 +1531,14 @@ impl<K, V> Clone for Keys<'_, K, V> {
15071531 }
15081532}
15091533
1534+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1535+ impl < K , V > Default for Keys < ' _ , K , V > {
1536+ #[ inline]
1537+ fn default ( ) -> Self {
1538+ Keys { inner : Default :: default ( ) }
1539+ }
1540+ }
1541+
15101542#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
15111543impl < K : Debug , V > fmt:: Debug for Keys < ' _ , K , V > {
15121544 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1546,6 +1578,14 @@ impl<K, V> Clone for Values<'_, K, V> {
15461578 }
15471579}
15481580
1581+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1582+ impl < K , V > Default for Values < ' _ , K , V > {
1583+ #[ inline]
1584+ fn default ( ) -> Self {
1585+ Values { inner : Default :: default ( ) }
1586+ }
1587+ }
1588+
15491589#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
15501590impl < K , V : Debug > fmt:: Debug for Values < ' _ , K , V > {
15511591 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1634,6 +1674,14 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
16341674 inner : IterMut < ' a , K , V > ,
16351675}
16361676
1677+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1678+ impl < K , V > Default for ValuesMut < ' _ , K , V > {
1679+ #[ inline]
1680+ fn default ( ) -> Self {
1681+ ValuesMut { inner : Default :: default ( ) }
1682+ }
1683+ }
1684+
16371685/// An owning iterator over the keys of a `HashMap`.
16381686///
16391687/// This `struct` is created by the [`into_keys`] method on [`HashMap`].
@@ -1656,6 +1704,14 @@ pub struct IntoKeys<K, V> {
16561704 inner : IntoIter < K , V > ,
16571705}
16581706
1707+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1708+ impl < K , V > Default for IntoKeys < K , V > {
1709+ #[ inline]
1710+ fn default ( ) -> Self {
1711+ IntoKeys { inner : Default :: default ( ) }
1712+ }
1713+ }
1714+
16591715/// An owning iterator over the values of a `HashMap`.
16601716///
16611717/// This `struct` is created by the [`into_values`] method on [`HashMap`].
@@ -1678,6 +1734,14 @@ pub struct IntoValues<K, V> {
16781734 inner : IntoIter < K , V > ,
16791735}
16801736
1737+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1738+ impl < K , V > Default for IntoValues < K , V > {
1739+ #[ inline]
1740+ fn default ( ) -> Self {
1741+ IntoValues { inner : Default :: default ( ) }
1742+ }
1743+ }
1744+
16811745/// A builder for computing where in a HashMap a key-value pair would be stored.
16821746///
16831747/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
0 commit comments