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

@@ -70,7 +70,7 @@ impl Iterator for ToLowercase {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.26.0")]
impl FusedIterator for ToLowercase {}
/// Returns an iterator that yields the uppercase equivalent of a `char`.
@@ -92,7 +92,7 @@ impl Iterator for ToUppercase {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.26.0")]
impl FusedIterator for ToUppercase {}
#[derive(Debug, Clone)]

View File

@@ -36,7 +36,6 @@
#![feature(str_internals)]
#![feature(decode_utf8)]
#![feature(fn_traits)]
#![feature(fused)]
#![feature(lang_items)]
#![feature(non_exhaustive)]
#![feature(staged_api)]

View File

@@ -127,7 +127,6 @@ impl<I> Iterator for Utf16Encoder<I>
}
}
#[unstable(feature = "fused", issue = "35602")]
impl<I> FusedIterator for Utf16Encoder<I>
where I: FusedIterator<Item = char> {}
@@ -186,5 +185,5 @@ impl<'a> DoubleEndedIterator for SplitWhitespace<'a> {
}
}
#[unstable(feature = "fused", issue = "35602")]
#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for SplitWhitespace<'a> {}