Skip to content

Commit 6caec2c

Browse files
committed
Document TrustedLen guarantees more explicitly
1 parent 75474ff commit 6caec2c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/libcore/iter/traits.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -970,9 +970,11 @@ impl<'a, I: FusedIterator + ?Sized> FusedIterator for &'a mut I {}
970970
/// The iterator reports a size hint where it is either exact
971971
/// (lower bound is equal to upper bound), or the upper bound is [`None`].
972972
/// The upper bound must only be [`None`] if the actual iterator length is
973-
/// larger than [`usize::MAX`].
973+
/// larger than [`usize::MAX`]. In that case, the lower bound must be
974+
/// [`usize::MAX`], resulting in a [`.size_hint`] of `(usize::MAX, None)`.
974975
///
975-
/// The iterator must produce exactly the number of elements it reported.
976+
/// The iterator must produce exactly the number of elements it reported
977+
/// or diverge before reaching the end.
976978
///
977979
/// # Safety
978980
///

0 commit comments

Comments
 (0)