@@ -3,7 +3,7 @@ use core::cmp::Ordering;
33use core:: error:: Error ;
44use core:: fmt:: { self , Debug } ;
55use core:: hash:: { Hash , Hasher } ;
6- use core:: iter:: FusedIterator ;
6+ use core:: iter:: { FusedIterator , TrustedLen } ;
77use core:: marker:: PhantomData ;
88use core:: mem:: { self , ManuallyDrop } ;
99use core:: ops:: { Bound , Index , RangeBounds } ;
@@ -1624,6 +1624,9 @@ impl<K, V> ExactSizeIterator for Iter<'_, K, V> {
16241624 }
16251625}
16261626
1627+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1628+ unsafe impl < K , V > TrustedLen for Iter < ' _ , K , V > { }
1629+
16271630#[ stable( feature = "rust1" , since = "1.0.0" ) ]
16281631impl < K , V > Clone for Iter < ' _ , K , V > {
16291632 fn clone ( & self ) -> Self {
@@ -1696,6 +1699,9 @@ impl<K, V> ExactSizeIterator for IterMut<'_, K, V> {
16961699 }
16971700}
16981701
1702+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1703+ unsafe impl < K , V > TrustedLen for IterMut < ' _ , K , V > { }
1704+
16991705#[ stable( feature = "fused" , since = "1.26.0" ) ]
17001706impl < K , V > FusedIterator for IterMut < ' _ , K , V > { }
17011707
@@ -1817,6 +1823,9 @@ impl<K, V, A: Allocator + Clone> ExactSizeIterator for IntoIter<K, V, A> {
18171823 }
18181824}
18191825
1826+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1827+ unsafe impl < K , V , A : Allocator + Clone > TrustedLen for IntoIter < K , V , A > { }
1828+
18201829#[ stable( feature = "fused" , since = "1.26.0" ) ]
18211830impl < K , V , A : Allocator + Clone > FusedIterator for IntoIter < K , V , A > { }
18221831
@@ -1865,6 +1874,9 @@ impl<K, V> ExactSizeIterator for Keys<'_, K, V> {
18651874 }
18661875}
18671876
1877+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1878+ unsafe impl < K , V > TrustedLen for Keys < ' _ , K , V > { }
1879+
18681880#[ stable( feature = "fused" , since = "1.26.0" ) ]
18691881impl < K , V > FusedIterator for Keys < ' _ , K , V > { }
18701882
@@ -1920,6 +1932,9 @@ impl<K, V> ExactSizeIterator for Values<'_, K, V> {
19201932 }
19211933}
19221934
1935+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
1936+ unsafe impl < K , V > TrustedLen for Values < ' _ , K , V > { }
1937+
19231938#[ stable( feature = "fused" , since = "1.26.0" ) ]
19241939impl < K , V > FusedIterator for Values < ' _ , K , V > { }
19251940
@@ -2160,6 +2175,9 @@ impl<K, V> ExactSizeIterator for ValuesMut<'_, K, V> {
21602175 }
21612176}
21622177
2178+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
2179+ unsafe impl < K , V > TrustedLen for ValuesMut < ' _ , K , V > { }
2180+
21632181#[ stable( feature = "fused" , since = "1.26.0" ) ]
21642182impl < K , V > FusedIterator for ValuesMut < ' _ , K , V > { }
21652183
@@ -2222,6 +2240,9 @@ impl<K, V, A: Allocator + Clone> ExactSizeIterator for IntoKeys<K, V, A> {
22222240 }
22232241}
22242242
2243+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
2244+ unsafe impl < K , V , A : Allocator + Clone > TrustedLen for IntoKeys < K , V , A > { }
2245+
22252246#[ stable( feature = "map_into_keys_values" , since = "1.54.0" ) ]
22262247impl < K , V , A : Allocator + Clone > FusedIterator for IntoKeys < K , V , A > { }
22272248
@@ -2273,6 +2294,9 @@ impl<K, V, A: Allocator + Clone> ExactSizeIterator for IntoValues<K, V, A> {
22732294 }
22742295}
22752296
2297+ #[ unstable( feature = "trusted_len" , issue = "37572" ) ]
2298+ unsafe impl < K , V , A : Allocator + Clone > TrustedLen for IntoValues < K , V , A > { }
2299+
22762300#[ stable( feature = "map_into_keys_values" , since = "1.54.0" ) ]
22772301impl < K , V , A : Allocator + Clone > FusedIterator for IntoValues < K , V , A > { }
22782302
0 commit comments