]> git.lizzy.rs Git - rust.git/commitdiff
Document TrustedLen guarantees more explicitly
authoroberien <jaro.fietz@gmx.de>
Sun, 4 Feb 2018 15:04:06 +0000 (16:04 +0100)
committeroberien <jaro.fietz@gmx.de>
Sun, 4 Feb 2018 15:09:32 +0000 (16:09 +0100)
src/libcore/iter/traits.rs

index 11e668d228c48a1b71ec7925fb7b9208049cf0e8..be4889f24877ced555dc55a7a85df01bd495b2ed 100644 (file)
@@ -970,9 +970,11 @@ impl<'a, I: FusedIterator + ?Sized> FusedIterator for &'a mut I {}
 /// The iterator reports a size hint where it is either exact
 /// (lower bound is equal to upper bound), or the upper bound is [`None`].
 /// The upper bound must only be [`None`] if the actual iterator length is
-/// larger than [`usize::MAX`].
+/// larger than [`usize::MAX`]. In that case, the lower bound must be
+/// [`usize::MAX`], resulting in a [`.size_hint`] of `(usize::MAX, None)`.
 ///
-/// The iterator must produce exactly the number of elements it reported.
+/// The iterator must produce exactly the number of elements it reported
+/// or diverge before reaching the end.
 ///
 /// # Safety
 ///