diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index 9e43d5688cecc..78cc62dd41dd3 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -1031,9 +1031,9 @@ impl Iterator for ops::RangeFrom { } } -// Safety: See above implementation for `ops::Range` +// Safety: RangeFrom::next() cannot return None #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl TrustedLen for ops::RangeFrom {} +unsafe impl TrustedLen for ops::RangeFrom {} #[stable(feature = "fused", since = "1.26.0")] impl FusedIterator for ops::RangeFrom {} diff --git a/library/core/src/range/iter.rs b/library/core/src/range/iter.rs index 24efd4a204a5f..acad00a51fb97 100644 --- a/library/core/src/range/iter.rs +++ b/library/core/src/range/iter.rs @@ -322,8 +322,9 @@ impl Iterator for IterRangeFrom { } } +// Safety: RangeFrom::next() cannot return None #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl TrustedLen for IterRangeFrom {} +unsafe impl TrustedLen for IterRangeFrom {} #[unstable(feature = "new_range_api", issue = "125687")] impl FusedIterator for IterRangeFrom {}