diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index f7ed811e44733..0f835689699fc 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -672,6 +672,11 @@ impl Iterator for ops::Range { self.next_back() } + #[inline] + fn is_sorted(self) -> bool { + true + } + #[inline] #[doc(hidden)] unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item @@ -1095,6 +1100,11 @@ impl Iterator for ops::RangeInclusive { fn max(mut self) -> Option { self.next_back() } + + #[inline] + fn is_sorted(self) -> bool { + true + } } #[stable(feature = "inclusive_range", since = "1.26.0")]