diff options
| author | oberien <jaro.fietz@gmx.de> | 2018-02-04 16:04:06 +0100 |
|---|---|---|
| committer | oberien <jaro.fietz@gmx.de> | 2018-02-04 16:09:32 +0100 |
| commit | 6caec2c0494a173f696e5a63583ff35d1bd106aa (patch) | |
| tree | a32edae9ce735d8915fc9c2aa59887c0909bbad7 /src/libcore | |
| parent | 75474ff1323c2968bb2dafc8b8f0af4817a89d01 (diff) | |
| download | rust-6caec2c0494a173f696e5a63583ff35d1bd106aa.tar.gz rust-6caec2c0494a173f696e5a63583ff35d1bd106aa.zip | |
Document TrustedLen guarantees more explicitly
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/traits.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcore/iter/traits.rs b/src/libcore/iter/traits.rs index 11e668d228c..be4889f2487 100644 --- a/src/libcore/iter/traits.rs +++ b/src/libcore/iter/traits.rs @@ -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 /// |
