@@ -1438,6 +1438,14 @@ impl<K, V> Clone for Iter<'_, K, V> {
14381438 }
14391439}
14401440
1441+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1442+ impl < K , V > Default for Iter < ' _ , K , V > {
1443+ #[ inline]
1444+ fn default ( ) -> Self {
1445+ Iter { base : Default :: default ( ) }
1446+ }
1447+ }
1448+
14411449#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
14421450impl < K : Debug , V : Debug > fmt:: Debug for Iter < ' _ , K , V > {
14431451 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1476,6 +1484,14 @@ impl<'a, K, V> IterMut<'a, K, V> {
14761484 }
14771485}
14781486
1487+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1488+ impl < K , V > Default for IterMut < ' _ , K , V > {
1489+ #[ inline]
1490+ fn default ( ) -> Self {
1491+ IterMut { base : Default :: default ( ) }
1492+ }
1493+ }
1494+
14791495/// An owning iterator over the entries of a `HashMap`.
14801496///
14811497/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
@@ -1506,6 +1522,14 @@ impl<K, V> IntoIter<K, V> {
15061522 }
15071523}
15081524
1525+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1526+ impl < K , V > Default for IntoIter < K , V > {
1527+ #[ inline]
1528+ fn default ( ) -> Self {
1529+ IntoIter { base : Default :: default ( ) }
1530+ }
1531+ }
1532+
15091533/// An iterator over the keys of a `HashMap`.
15101534///
15111535/// This `struct` is created by the [`keys`] method on [`HashMap`]. See its
@@ -1538,6 +1562,14 @@ impl<K, V> Clone for Keys<'_, K, V> {
15381562 }
15391563}
15401564
1565+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1566+ impl < K , V > Default for Keys < ' _ , K , V > {
1567+ #[ inline]
1568+ fn default ( ) -> Self {
1569+ Keys { inner : Default :: default ( ) }
1570+ }
1571+ }
1572+
15411573#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
15421574impl < K : Debug , V > fmt:: Debug for Keys < ' _ , K , V > {
15431575 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1577,6 +1609,14 @@ impl<K, V> Clone for Values<'_, K, V> {
15771609 }
15781610}
15791611
1612+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1613+ impl < K , V > Default for Values < ' _ , K , V > {
1614+ #[ inline]
1615+ fn default ( ) -> Self {
1616+ Values { inner : Default :: default ( ) }
1617+ }
1618+ }
1619+
15801620#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
15811621impl < K , V : Debug > fmt:: Debug for Values < ' _ , K , V > {
15821622 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1665,6 +1705,14 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
16651705 inner : IterMut < ' a , K , V > ,
16661706}
16671707
1708+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1709+ impl < K , V > Default for ValuesMut < ' _ , K , V > {
1710+ #[ inline]
1711+ fn default ( ) -> Self {
1712+ ValuesMut { inner : Default :: default ( ) }
1713+ }
1714+ }
1715+
16681716/// An owning iterator over the keys of a `HashMap`.
16691717///
16701718/// This `struct` is created by the [`into_keys`] method on [`HashMap`].
@@ -1687,6 +1735,14 @@ pub struct IntoKeys<K, V> {
16871735 inner : IntoIter < K , V > ,
16881736}
16891737
1738+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1739+ impl < K , V > Default for IntoKeys < K , V > {
1740+ #[ inline]
1741+ fn default ( ) -> Self {
1742+ IntoKeys { inner : Default :: default ( ) }
1743+ }
1744+ }
1745+
16901746/// An owning iterator over the values of a `HashMap`.
16911747///
16921748/// This `struct` is created by the [`into_values`] method on [`HashMap`].
@@ -1709,6 +1765,14 @@ pub struct IntoValues<K, V> {
17091765 inner : IntoIter < K , V > ,
17101766}
17111767
1768+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1769+ impl < K , V > Default for IntoValues < K , V > {
1770+ #[ inline]
1771+ fn default ( ) -> Self {
1772+ IntoValues { inner : Default :: default ( ) }
1773+ }
1774+ }
1775+
17121776/// A builder for computing where in a HashMap a key-value pair would be stored.
17131777///
17141778/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
0 commit comments