about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-02-01 13:34:07 +0100
committerSimon Sapin <simon.sapin@exyr.org>2019-02-12 09:55:29 +0100
commit55216f82a69092fdb22fb779d3f64d3d756c7ed8 (patch)
treea1a965a410a525205c689e1f3676d0d2d974481f /src/liballoc
parent7a077804a3a58c93f690e382c86ccd4f1a8850af (diff)
downloadrust-55216f82a69092fdb22fb779d3f64d3d756c7ed8.tar.gz
rust-55216f82a69092fdb22fb779d3f64d3d756c7ed8.zip
Stabilize str::escape_* methods
FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/str.rs20
-rw-r--r--src/liballoc/tests/lib.rs1
2 files changed, 7 insertions, 14 deletions
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 @@ impl str {
     /// 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 @@ impl str {
     /// 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 @@ impl str {
     /// 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 @@ macro_rules! escape_types {
             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 @@ macro_rules! escape_types {
             }
         }
 
-        #[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)]