Skip to content

Commit 55d6247

Browse files
committed
Clarify that guarantees extend to other advancing iterator methods.
1 parent 7ce1b3b commit 55d6247

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/core/src/iter/traits/marker.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ unsafe impl<I: TrustedLen + ?Sized> TrustedLen for &mut I {}
4343
/// An iterator that when yielding an item will have taken at least one element
4444
/// from its underlying [`SourceIter`].
4545
///
46-
/// Calling [`next()`] guarantees that at least one value of the iterator's underlying source
47-
/// has been moved out and the result of the iterator chain could be inserted in its place,
48-
/// assuming structural constraints of the source allow such an insertion.
46+
/// Calling any method that advances the iterator, e.g. [`next()`] or [`try_fold()`],
47+
/// guarantees that for each step at least one value of the iterator's underlying source
48+
/// has been moved out and the result of the iterator chain could be inserted
49+
/// in its place, assuming structural constraints of the source allow such an insertion.
4950
/// In other words this trait indicates that an iterator pipeline can be collected in place.
5051
///
5152
/// [`SourceIter`]: crate::iter::SourceIter
5253
/// [`next()`]: Iterator::next
54+
/// [`try_fold()`]: Iterator::try_fold
5355
#[unstable(issue = "none", feature = "inplace_iteration")]
5456
pub unsafe trait InPlaceIterable: Iterator {}

0 commit comments

Comments
 (0)