Rollup merge of #47463 - bluss:fused-iterator, r=alexcrichton

Stabilize FusedIterator

FusedIterator is a marker trait that promises that the implementing
iterator continues to return `None` from `.next()` once it has returned
`None` once (and/or `.next_back()`, if implemented).

The effects of FusedIterator are already widely available through
`.fuse()`, but with stable `FusedIterator`, stable Rust users can
implement this trait for their iterators when appropriate.

Closes #35602
This commit is contained in:
kennytm
2018-03-06 18:21:35 +08:00
28 changed files with 109 additions and 116 deletions

View File

@@ -2273,7 +2273,7 @@ impl<T> ExactSizeIterator for IntoIter<T> {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.26.0")]
impl<T> FusedIterator for IntoIter<T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
@@ -2379,7 +2379,7 @@ impl<'a, T> ExactSizeIterator for Drain<'a, T> {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.26.0")]
impl<'a, T> FusedIterator for Drain<'a, T> {}
/// A place for insertion at the back of a `Vec`.