Skip to content

Commit

Permalink
std: Stabilize char_escape_debug
Browse files Browse the repository at this point in the history
Stabilizes:

* `<char>::escape_debug`
* `std::char::EscapeDebug`

Closes #35068
  • Loading branch information
alexcrichton committed Jul 25, 2017
1 parent 5c126bd commit 4c9c6e8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@

#![cfg_attr(test, allow(deprecated))] // rand
#![cfg_attr(test, feature(placement_in))]
#![cfg_attr(not(test), feature(char_escape_debug))]
#![cfg_attr(not(test), feature(core_float))]
#![cfg_attr(not(test), feature(exact_size_is_empty))]
#![cfg_attr(not(test), feature(slice_rotate))]
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub trait CharExt {
fn escape_unicode(self) -> EscapeUnicode;
#[stable(feature = "core", since = "1.6.0")]
fn escape_default(self) -> EscapeDefault;
#[unstable(feature = "char_escape_debug", issue = "35068")]
#[stable(feature = "char_escape_debug", since = "1.20.0")]
fn escape_debug(self) -> EscapeDebug;
#[stable(feature = "core", since = "1.6.0")]
fn len_utf8(self) -> usize;
Expand Down Expand Up @@ -776,24 +776,24 @@ impl fmt::Display for EscapeDefault {
///
/// [`escape_debug`]: ../../std/primitive.char.html#method.escape_debug
/// [`char`]: ../../std/primitive.char.html
#[unstable(feature = "char_escape_debug", issue = "35068")]
#[stable(feature = "char_escape_debug", since = "1.20.0")]
#[derive(Clone, Debug)]
pub struct EscapeDebug(EscapeDefault);

#[unstable(feature = "char_escape_debug", issue = "35068")]
#[stable(feature = "char_escape_debug", since = "1.20.0")]
impl Iterator for EscapeDebug {
type Item = char;
fn next(&mut self) -> Option<char> { self.0.next() }
fn size_hint(&self) -> (usize, Option<usize>) { self.0.size_hint() }
}

#[unstable(feature = "char_escape_debug", issue = "35068")]
#[stable(feature = "char_escape_debug", since = "1.20.0")]
impl ExactSizeIterator for EscapeDebug { }

#[unstable(feature = "fused", issue = "35602")]
impl FusedIterator for EscapeDebug {}

#[unstable(feature = "char_escape_debug", issue = "35068")]
#[stable(feature = "char_escape_debug", since = "1.20.0")]
impl fmt::Display for EscapeDebug {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self.0, f)
Expand Down
1 change: 0 additions & 1 deletion src/libcore/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#![deny(warnings)]

#![feature(box_syntax)]
#![feature(char_escape_debug)]
#![feature(const_fn)]
#![feature(core_float)]
#![feature(core_private_bignum)]
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@
#![feature(cfg_target_has_atomic)]
#![feature(cfg_target_thread_local)]
#![feature(cfg_target_vendor)]
#![feature(char_escape_debug)]
#![feature(char_error_internals)]
#![feature(char_internals)]
#![feature(collections_range)]
Expand Down
5 changes: 1 addition & 4 deletions src/libstd_unicode/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ impl char {
/// As an iterator:
///
/// ```
/// # #![feature(char_escape_debug)]
/// for c in '\n'.escape_debug() {
/// print!("{}", c);
/// }
Expand All @@ -336,7 +335,6 @@ impl char {
/// Using `println!` directly:
///
/// ```
/// # #![feature(char_escape_debug)]
/// println!("{}", '\n'.escape_debug());
/// ```
///
Expand All @@ -349,10 +347,9 @@ impl char {
/// Using `to_string`:
///
/// ```
/// # #![feature(char_escape_debug)]
/// assert_eq!('\n'.escape_debug().to_string(), "\\n");
/// ```
#[unstable(feature = "char_escape_debug", issue = "35068")]
#[stable(feature = "char_escape_debug", since = "1.20.0")]
#[inline]
pub fn escape_debug(self) -> EscapeDebug {
C::escape_debug(self)
Expand Down
1 change: 0 additions & 1 deletion src/libstd_unicode/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#![deny(warnings)]
#![no_std]

#![feature(char_escape_debug)]
#![feature(core_char_ext)]
#![feature(str_internals)]
#![feature(core_intrinsics)]
Expand Down

0 comments on commit 4c9c6e8

Please sign in to comment.