Skip to content

Commit 55216f8

Browse files
committed
Stabilize str::escape_* methods
FCP: rust-lang#27791 (comment)
1 parent 7a07780 commit 55216f8

File tree

6 files changed

+7
-20
lines changed

6 files changed

+7
-20
lines changed

src/liballoc/str.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,7 @@ impl str {
452452
/// escaped.
453453
///
454454
/// [`char::escape_debug`]: primitive.char.html#method.escape_debug
455-
#[unstable(feature = "str_escape",
456-
reason = "return type may change to be an iterator",
457-
issue = "27791")]
455+
#[stable(feature = "str_escape", since = "1.34.0")]
458456
pub fn escape_debug(&self) -> EscapeDebug {
459457
let mut chars = self.chars();
460458
EscapeDebug {
@@ -469,19 +467,15 @@ impl str {
469467
/// Escapes each char in `s` with [`char::escape_default`].
470468
///
471469
/// [`char::escape_default`]: primitive.char.html#method.escape_default
472-
#[unstable(feature = "str_escape",
473-
reason = "return type may change to be an iterator",
474-
issue = "27791")]
470+
#[stable(feature = "str_escape", since = "1.34.0")]
475471
pub fn escape_default(&self) -> EscapeDefault {
476472
EscapeDefault { inner: self.chars().flat_map(CharEscapeDefault) }
477473
}
478474

479475
/// Escapes each char in `s` with [`char::escape_unicode`].
480476
///
481477
/// [`char::escape_unicode`]: primitive.char.html#method.escape_unicode
482-
#[unstable(feature = "str_escape",
483-
reason = "return type may change to be an iterator",
484-
issue = "27791")]
478+
#[stable(feature = "str_escape", since = "1.34.0")]
485479
pub fn escape_unicode(&self) -> EscapeUnicode {
486480
EscapeUnicode { inner: self.chars().flat_map(CharEscapeUnicode) }
487481
}
@@ -639,20 +633,20 @@ macro_rules! escape_types {
639633
inner: $Inner: ty,
640634
}
641635
)+) => {$(
642-
#[unstable(feature = "str_escape", issue = "27791")]
636+
#[stable(feature = "str_escape", since = "1.34.0")]
643637
#[derive(Clone, Debug)]
644638
pub struct $Name<'a> {
645639
inner: $Inner,
646640
}
647641

648-
#[unstable(feature = "str_escape", issue = "27791")]
642+
#[stable(feature = "str_escape", since = "1.34.0")]
649643
impl<'a> fmt::Display for $Name<'a> {
650644
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
651645
self.clone().try_for_each(|c| f.write_char(c))
652646
}
653647
}
654648

655-
#[unstable(feature = "str_escape", issue = "27791")]
649+
#[stable(feature = "str_escape", since = "1.34.0")]
656650
impl<'a> Iterator for $Name<'a> {
657651
type Item = char;
658652

@@ -677,7 +671,7 @@ macro_rules! escape_types {
677671
}
678672
}
679673

680-
#[unstable(feature = "str_escape", issue = "27791")]
674+
#[stable(feature = "str_escape", since = "1.34.0")]
681675
impl<'a> FusedIterator for $Name<'a> {}
682676
)+}
683677
}

src/liballoc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(pattern)]
66
#![feature(repeat_generic_slice)]
77
#![feature(slice_sort_by_cached_key)]
8-
#![feature(str_escape)]
98
#![feature(try_reserve)]
109
#![feature(unboxed_closures)]
1110
#![feature(vecdeque_rotate)]

src/libgraphviz/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@
277277
#![deny(rust_2018_idioms)]
278278

279279
#![feature(nll)]
280-
#![feature(str_escape)]
281280

282281
use LabelText::*;
283282

src/libsyntax/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(rustc_attrs)]
1616
#![feature(rustc_diagnostic_macros)]
1717
#![feature(slice_sort_by_cached_key)]
18-
#![feature(str_escape)]
1918
#![feature(step_trait)]
2019
#![feature(try_trait)]
2120
#![feature(unicode_internals)]

src/libsyntax_ext/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![feature(proc_macro_span)]
1111
#![feature(decl_macro)]
1212
#![feature(nll)]
13-
#![feature(str_escape)]
1413
#![feature(rustc_diagnostic_macros)]
1514

1615
#![recursion_limit="256"]

src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// pretty-expanded FIXME #23616
33

44
#![allow(warnings)]
5-
#![feature(iter_empty)]
6-
#![feature(iter_once)]
7-
#![feature(str_escape)]
85

96
use std::iter::{empty, once, repeat};
107

0 commit comments

Comments
 (0)