File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -666,7 +666,19 @@ pub trait FusedIterator: Iterator {}
666
666
#[ unstable( feature = "fused" , issue = "35602" ) ]
667
667
impl < ' a , I : FusedIterator + ?Sized > FusedIterator for & ' a mut I { }
668
668
669
- /// An iterator that has correct length
669
+ /// An iterator that reports an accurate length using size_hint.
670
+ ///
671
+ /// The iterator reports a size hint where it is either exact
672
+ /// (lower bound is equal to upper bound), or the upper bound is `None`.
673
+ /// The upper bound must only be `None` if the actual iterator length is
674
+ /// larger than `usize::MAX`.
675
+ ///
676
+ /// The iterator must produce exactly the number of elements it reported.
677
+ ///
678
+ /// # Safety
679
+ ///
680
+ /// This trait must only be implemented when the contract is upheld.
681
+ /// Consumers of this trait must inspect `.size_hint()`’s upper bound.
670
682
#[ unstable( feature = "trusted_len" , issue = "0" ) ]
671
683
pub unsafe trait TrustedLen : Iterator { }
672
684
You can’t perform that action at this time.
0 commit comments