core: 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.
This commit is contained in:
Ulrik Sverdrup 2018-01-15 19:59:10 +01:00
parent c9b86a9178
commit bc651cac8d
28 changed files with 110 additions and 114 deletions

View file

@ -1991,7 +1991,7 @@ impl<'a, T> ExactSizeIterator for Iter<'a, T> {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.25.0")]
impl<'a, T> FusedIterator for Iter<'a, T> {}
@ -2084,7 +2084,7 @@ impl<'a, T> ExactSizeIterator for IterMut<'a, T> {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.25.0")]
impl<'a, T> FusedIterator for IterMut<'a, T> {}
/// An owning iterator over the elements of a `VecDeque`.
@ -2140,7 +2140,7 @@ impl<T> ExactSizeIterator for IntoIter<T> {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.25.0")]
impl<T> FusedIterator for IntoIter<T> {}
/// A draining iterator over the elements of a `VecDeque`.
@ -2247,7 +2247,7 @@ impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
#[stable(feature = "drain", since = "1.6.0")]
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.25.0")]
impl<'a, T: 'a> FusedIterator for Drain<'a, T> {}
#[stable(feature = "rust1", since = "1.0.0")]