From 6a01f8aecd610d1d1236c452d83561d8bab69f06 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 1 Feb 2019 11:24:12 +0100 Subject: [PATCH] Stabilize split_ascii_whitespace Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750 --- src/liballoc/lib.rs | 1 - src/liballoc/str.rs | 2 +- src/libcore/str/mod.rs | 11 +++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 5165a7ca5a8..bd2d8461bf6 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -98,7 +98,6 @@ #![feature(rustc_attrs)] #![feature(receiver_trait)] #![feature(specialization)] -#![feature(split_ascii_whitespace)] #![feature(staged_api)] #![feature(str_internals)] #![feature(trusted_len)] diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 60d9f162613..53dd1a5df30 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -68,7 +68,7 @@ pub use core::str::SplitWhitespace; pub use core::str::pattern; #[stable(feature = "encode_utf16", since = "1.8.0")] pub use core::str::EncodeUtf16; -#[unstable(feature = "split_ascii_whitespace", issue = "48656")] +#[stable(feature = "split_ascii_whitespace", since = "1.34.0")] pub use core::str::SplitAsciiWhitespace; #[unstable(feature = "slice_concat_ext", diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 3cb39360380..130142103a9 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -2700,7 +2700,6 @@ impl str { /// Basic usage: /// /// ``` - /// #![feature(split_ascii_whitespace)] /// let mut iter = "A few words".split_ascii_whitespace(); /// /// assert_eq!(Some("A"), iter.next()); @@ -2722,7 +2721,7 @@ impl str { /// /// assert_eq!(None, iter.next()); /// ``` - #[unstable(feature = "split_ascii_whitespace", issue = "48656")] + #[stable(feature = "split_ascii_whitespace", since = "1.34.0")] #[inline] pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace { let inner = self @@ -4009,7 +4008,7 @@ pub struct SplitWhitespace<'a> { /// /// [`split_ascii_whitespace`]: ../../std/primitive.str.html#method.split_ascii_whitespace /// [`str`]: ../../std/primitive.str.html -#[unstable(feature = "split_ascii_whitespace", issue = "48656")] +#[stable(feature = "split_ascii_whitespace", since = "1.34.0")] #[derive(Clone, Debug)] pub struct SplitAsciiWhitespace<'a> { inner: Map, IsNotEmpty>, UnsafeBytesToStr>, @@ -4134,7 +4133,7 @@ impl<'a> DoubleEndedIterator for SplitWhitespace<'a> { #[stable(feature = "fused", since = "1.26.0")] impl FusedIterator for SplitWhitespace<'_> {} -#[unstable(feature = "split_ascii_whitespace", issue = "48656")] +#[stable(feature = "split_ascii_whitespace", since = "1.34.0")] impl<'a> Iterator for SplitAsciiWhitespace<'a> { type Item = &'a str; @@ -4149,7 +4148,7 @@ impl<'a> Iterator for SplitAsciiWhitespace<'a> { } } -#[unstable(feature = "split_ascii_whitespace", issue = "48656")] +#[stable(feature = "split_ascii_whitespace", since = "1.34.0")] impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a> { #[inline] fn next_back(&mut self) -> Option<&'a str> { @@ -4157,7 +4156,7 @@ impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a> { } } -#[unstable(feature = "split_ascii_whitespace", issue = "48656")] +#[stable(feature = "split_ascii_whitespace", since = "1.34.0")] impl FusedIterator for SplitAsciiWhitespace<'_> {} /// An iterator of [`u16`] over the string encoded as UTF-16.