From: Simon Sapin Date: Fri, 1 Feb 2019 12:34:07 +0000 (+0100) Subject: Stabilize str::escape_* methods X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=55216f82a69092fdb22fb779d3f64d3d756c7ed8;p=rust.git Stabilize str::escape_* methods FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727 --- diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 1705c80d5f5..8daa088a21a 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -452,9 +452,7 @@ pub fn to_uppercase(&self) -> String { /// escaped. /// /// [`char::escape_debug`]: primitive.char.html#method.escape_debug - #[unstable(feature = "str_escape", - reason = "return type may change to be an iterator", - issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] pub fn escape_debug(&self) -> EscapeDebug { let mut chars = self.chars(); EscapeDebug { @@ -469,9 +467,7 @@ pub fn escape_debug(&self) -> EscapeDebug { /// Escapes each char in `s` with [`char::escape_default`]. /// /// [`char::escape_default`]: primitive.char.html#method.escape_default - #[unstable(feature = "str_escape", - reason = "return type may change to be an iterator", - issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] pub fn escape_default(&self) -> EscapeDefault { EscapeDefault { inner: self.chars().flat_map(CharEscapeDefault) } } @@ -479,9 +475,7 @@ pub fn escape_default(&self) -> EscapeDefault { /// Escapes each char in `s` with [`char::escape_unicode`]. /// /// [`char::escape_unicode`]: primitive.char.html#method.escape_unicode - #[unstable(feature = "str_escape", - reason = "return type may change to be an iterator", - issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] pub fn escape_unicode(&self) -> EscapeUnicode { EscapeUnicode { inner: self.chars().flat_map(CharEscapeUnicode) } } @@ -639,20 +633,20 @@ struct $Name: ident<'a> { inner: $Inner: ty, } )+) => {$( - #[unstable(feature = "str_escape", issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] #[derive(Clone, Debug)] pub struct $Name<'a> { inner: $Inner, } - #[unstable(feature = "str_escape", issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] impl<'a> fmt::Display for $Name<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.clone().try_for_each(|c| f.write_char(c)) } } - #[unstable(feature = "str_escape", issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] impl<'a> Iterator for $Name<'a> { type Item = char; @@ -677,7 +671,7 @@ fn fold(self, init: Acc, fold: Fold) -> Acc } } - #[unstable(feature = "str_escape", issue = "27791")] + #[stable(feature = "str_escape", since = "1.34.0")] impl<'a> FusedIterator for $Name<'a> {} )+} } diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index a76fd87a1a9..2b63ac5c7d2 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -5,7 +5,6 @@ #![feature(pattern)] #![feature(repeat_generic_slice)] #![feature(slice_sort_by_cached_key)] -#![feature(str_escape)] #![feature(try_reserve)] #![feature(unboxed_closures)] #![feature(vecdeque_rotate)] diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 6ee151a6484..e54ebae42cf 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -277,7 +277,6 @@ #![deny(rust_2018_idioms)] #![feature(nll)] -#![feature(str_escape)] use LabelText::*; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index c844f9e2a91..a56cdf623bf 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -15,7 +15,6 @@ #![feature(rustc_attrs)] #![feature(rustc_diagnostic_macros)] #![feature(slice_sort_by_cached_key)] -#![feature(str_escape)] #![feature(step_trait)] #![feature(try_trait)] #![feature(unicode_internals)] diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 7d7fd030859..0232c19e896 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -10,7 +10,6 @@ #![feature(proc_macro_span)] #![feature(decl_macro)] #![feature(nll)] -#![feature(str_escape)] #![feature(rustc_diagnostic_macros)] #![recursion_limit="256"] diff --git a/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs b/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs index 903bbf51634..44beb9dc1e5 100644 --- a/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs +++ b/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs @@ -2,9 +2,6 @@ // pretty-expanded FIXME #23616 #![allow(warnings)] -#![feature(iter_empty)] -#![feature(iter_once)] -#![feature(str_escape)] use std::iter::{empty, once, repeat};