@@ -599,6 +599,9 @@ macro_rules! range_exact_iter_impl {
599
599
( $( $t: ty) * ) => ( $(
600
600
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
601
601
impl ExactSizeIterator for RangeIter <$t> { }
602
+
603
+ #[ stable( feature = "new_range" , since = "1.0.0" ) ]
604
+ impl ExactSizeIterator for RangeIterMut <' _, $t> { }
602
605
) * )
603
606
}
604
607
@@ -622,6 +625,9 @@ macro_rules! range_incl_exact_iter_impl {
622
625
( $( $t: ty) * ) => ( $(
623
626
#[ stable( feature = "inclusive_range" , since = "1.26.0" ) ]
624
627
impl ExactSizeIterator for RangeInclusiveIter <$t> { }
628
+
629
+ #[ stable( feature = "new_range" , since = "1.0.0" ) ]
630
+ impl ExactSizeIterator for RangeInclusiveIterMut <' _, $t> { }
625
631
) * )
626
632
}
627
633
@@ -839,6 +845,10 @@ impl<'a, Idx: Step> Iterator for RangeIterMut<'a, Idx> {
839
845
840
846
out
841
847
}
848
+
849
+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
850
+ self . range . size_hint ( )
851
+ }
842
852
}
843
853
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
844
854
impl < ' a , Idx : Step > DoubleEndedIterator for RangeIterMut < ' a , Idx > {
@@ -953,6 +963,10 @@ impl<'a, Idx: Step> Iterator for RangeFromIterMut<'a, Idx> {
953
963
954
964
out
955
965
}
966
+
967
+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
968
+ self . range . size_hint ( )
969
+ }
956
970
}
957
971
958
972
impl < Idx : Step > ops:: range:: RangeFrom < Idx > {
@@ -1155,6 +1169,10 @@ impl<'a, Idx: Step> Iterator for RangeInclusiveIterMut<'a, Idx> {
1155
1169
1156
1170
out
1157
1171
}
1172
+
1173
+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1174
+ self . range . size_hint ( )
1175
+ }
1158
1176
}
1159
1177
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
1160
1178
impl < ' a , Idx : Step > DoubleEndedIterator for RangeInclusiveIterMut < ' a , Idx > {
@@ -1494,7 +1512,7 @@ impl<Idx: Step> ops::range::$ty<Idx> {
1494
1512
1495
1513
/// Alias for `.iter_mut()`
1496
1514
///
1497
- /// See [`Iterator:: iter_mut`]
1515
+ /// See [`iter_mut`](Self::iter_mut)
1498
1516
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
1499
1517
#[ deprecated( since = "1.0.0" , note = "range-experiment-mut-self" ) ]
1500
1518
pub fn by_ref( & mut self ) -> <& mut Self as IntoIterator >:: IntoIter {
@@ -1998,7 +2016,7 @@ impl<Idx: Step> ops::range::$ty<Idx> {
1998
2016
1999
2017
/// Shorthand for `.iter_mut().advance_back_by(...)`
2000
2018
///
2001
- /// See [`Iterator ::advance_back_by`]
2019
+ /// See [`DoubleEndedIterator ::advance_back_by`]
2002
2020
#[ unstable( feature = "iter_advance_by" , reason = "recently added" , issue = "77404" ) ]
2003
2021
#[ deprecated( since = "1.0.0" , note = "range-experiment-mut-self" ) ]
2004
2022
pub fn advance_back_by( & mut self , n: usize ) -> Result <( ) , NonZeroUsize > {
@@ -2007,7 +2025,7 @@ impl<Idx: Step> ops::range::$ty<Idx> {
2007
2025
2008
2026
/// Shorthand for `.iter_mut().nth_back(...)`
2009
2027
///
2010
- /// See [`Iterator ::nth_back`]
2028
+ /// See [`DoubleEndedIterator ::nth_back`]
2011
2029
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
2012
2030
#[ deprecated( since = "1.0.0" , note = "range-experiment-mut-self" ) ]
2013
2031
pub fn nth_back( & mut self , n: usize ) -> Option <Idx > {
@@ -2016,7 +2034,7 @@ impl<Idx: Step> ops::range::$ty<Idx> {
2016
2034
2017
2035
/// Shorthand for `.iter_mut().try_rfold(...)`
2018
2036
///
2019
- /// See [`Iterator ::try_rfold`]
2037
+ /// See [`DoubleEndedIterator ::try_rfold`]
2020
2038
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
2021
2039
#[ deprecated( since = "1.0.0" , note = "range-experiment-mut-self" ) ]
2022
2040
pub fn try_rfold<B , F , R >( & mut self , init: B , f: F ) -> R
@@ -2029,7 +2047,7 @@ impl<Idx: Step> ops::range::$ty<Idx> {
2029
2047
2030
2048
/// Shorthand for `.into_iter().rfold(...)`
2031
2049
///
2032
- /// See [`Iterator ::rfold`]
2050
+ /// See [`DoubleEndedIterator ::rfold`]
2033
2051
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
2034
2052
pub fn rfold<B , F >( self , init: B , f: F ) -> B
2035
2053
where
@@ -2040,7 +2058,7 @@ impl<Idx: Step> ops::range::$ty<Idx> {
2040
2058
2041
2059
/// Shorthand for `.iter_mut().rfind(...)`
2042
2060
///
2043
- /// See [`Iterator ::rfind`]
2061
+ /// See [`DoubleEndedIterator ::rfind`]
2044
2062
#[ stable( feature = "new_range" , since = "1.0.0" ) ]
2045
2063
#[ deprecated( since = "1.0.0" , note = "range-experiment-mut-self" ) ]
2046
2064
pub fn rfind<P >( & mut self , predicate: P ) -> Option <Idx >
0 commit comments