@@ -1404,6 +1404,14 @@ impl<K, V> Clone for Iter<'_, K, V> {
14041404 }
14051405}
14061406
1407+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1408+ impl < K , V > Default for Iter < ' _ , K , V > {
1409+ #[ inline]
1410+ fn default ( ) -> Self {
1411+ Iter { base : Default :: default ( ) }
1412+ }
1413+ }
1414+
14071415#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
14081416impl < K : Debug , V : Debug > fmt:: Debug for Iter < ' _ , K , V > {
14091417 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1441,6 +1449,14 @@ impl<'a, K, V> IterMut<'a, K, V> {
14411449 }
14421450}
14431451
1452+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1453+ impl < K , V > Default for IterMut < ' _ , K , V > {
1454+ #[ inline]
1455+ fn default ( ) -> Self {
1456+ IterMut { base : Default :: default ( ) }
1457+ }
1458+ }
1459+
14441460/// An owning iterator over the entries of a `HashMap`.
14451461///
14461462/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
@@ -1471,6 +1487,14 @@ impl<K, V> IntoIter<K, V> {
14711487 }
14721488}
14731489
1490+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1491+ impl < K , V > Default for IntoIter < K , V > {
1492+ #[ inline]
1493+ fn default ( ) -> Self {
1494+ IntoIter { base : Default :: default ( ) }
1495+ }
1496+ }
1497+
14741498/// An iterator over the keys of a `HashMap`.
14751499///
14761500/// This `struct` is created by the [`keys`] method on [`HashMap`]. See its
@@ -1502,6 +1526,14 @@ impl<K, V> Clone for Keys<'_, K, V> {
15021526 }
15031527}
15041528
1529+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1530+ impl < K , V > Default for Keys < ' _ , K , V > {
1531+ #[ inline]
1532+ fn default ( ) -> Self {
1533+ Keys { inner : Default :: default ( ) }
1534+ }
1535+ }
1536+
15051537#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
15061538impl < K : Debug , V > fmt:: Debug for Keys < ' _ , K , V > {
15071539 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1540,6 +1572,14 @@ impl<K, V> Clone for Values<'_, K, V> {
15401572 }
15411573}
15421574
1575+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1576+ impl < K , V > Default for Values < ' _ , K , V > {
1577+ #[ inline]
1578+ fn default ( ) -> Self {
1579+ Values { inner : Default :: default ( ) }
1580+ }
1581+ }
1582+
15431583#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
15441584impl < K , V : Debug > fmt:: Debug for Values < ' _ , K , V > {
15451585 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1626,6 +1666,14 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
16261666 inner : IterMut < ' a , K , V > ,
16271667}
16281668
1669+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1670+ impl < K , V > Default for ValuesMut < ' _ , K , V > {
1671+ #[ inline]
1672+ fn default ( ) -> Self {
1673+ ValuesMut { inner : Default :: default ( ) }
1674+ }
1675+ }
1676+
16291677/// An owning iterator over the keys of a `HashMap`.
16301678///
16311679/// This `struct` is created by the [`into_keys`] method on [`HashMap`].
@@ -1648,6 +1696,14 @@ pub struct IntoKeys<K, V> {
16481696 inner : IntoIter < K , V > ,
16491697}
16501698
1699+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1700+ impl < K , V > Default for IntoKeys < K , V > {
1701+ #[ inline]
1702+ fn default ( ) -> Self {
1703+ IntoKeys { inner : Default :: default ( ) }
1704+ }
1705+ }
1706+
16511707/// An owning iterator over the values of a `HashMap`.
16521708///
16531709/// This `struct` is created by the [`into_values`] method on [`HashMap`].
@@ -1670,6 +1726,14 @@ pub struct IntoValues<K, V> {
16701726 inner : IntoIter < K , V > ,
16711727}
16721728
1729+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1730+ impl < K , V > Default for IntoValues < K , V > {
1731+ #[ inline]
1732+ fn default ( ) -> Self {
1733+ IntoValues { inner : Default :: default ( ) }
1734+ }
1735+ }
1736+
16731737/// A builder for computing where in a HashMap a key-value pair would be stored.
16741738///
16751739/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
0 commit comments