Skip to content

Commit de6e973

Browse files
committed
Stabilise inherent_ascii_escape (FCP in #77174)
1 parent 9efe61d commit de6e973

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
#![feature(extend_one)]
113113
#![feature(fmt_internals)]
114114
#![feature(fn_traits)]
115-
#![feature(inherent_ascii_escape)]
116115
#![feature(inplace_iteration)]
117116
#![feature(iter_advance_by)]
118117
#![feature(layout_for_ptr)]

library/alloc/src/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub use core::slice::ArrayChunks;
108108
pub use core::slice::ArrayChunksMut;
109109
#[unstable(feature = "array_windows", issue = "75027")]
110110
pub use core::slice::ArrayWindows;
111-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
111+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
112112
pub use core::slice::EscapeAscii;
113113
#[stable(feature = "slice_get_slice", since = "1.28.0")]
114114
pub use core::slice::SliceIndex;

library/core/src/num/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,6 @@ impl u8 {
791791
/// # Examples
792792
///
793793
/// ```
794-
/// #![feature(inherent_ascii_escape)]
795794
///
796795
/// assert_eq!("0", b'0'.escape_ascii().to_string());
797796
/// assert_eq!("\\t", b'\t'.escape_ascii().to_string());
@@ -804,7 +803,7 @@ impl u8 {
804803
/// ```
805804
#[must_use = "this returns the escaped byte as an iterator, \
806805
without modifying the original"]
807-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
806+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
808807
#[inline]
809808
pub fn escape_ascii(self) -> ascii::EscapeDefault {
810809
ascii::escape_default(self)

library/core/src/slice/ascii.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@ impl [u8] {
6868
/// # Examples
6969
///
7070
/// ```
71-
/// #![feature(inherent_ascii_escape)]
7271
///
7372
/// let s = b"0\t\r\n'\"\\\x9d";
7473
/// let escaped = s.escape_ascii().to_string();
7574
/// assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
7675
/// ```
7776
#[must_use = "this returns the escaped bytes as an iterator, \
7877
without modifying the original"]
79-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
78+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
8079
pub fn escape_ascii(&self) -> EscapeAscii<'_> {
8180
EscapeAscii { inner: self.iter().flat_map(EscapeByte) }
8281
}
@@ -93,13 +92,13 @@ impl_fn_for_zst! {
9392
///
9493
/// This `struct` is created by the [`slice::escape_ascii`] method. See its
9594
/// documentation for more information.
96-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
95+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
9796
#[derive(Clone)]
9897
pub struct EscapeAscii<'a> {
9998
inner: iter::FlatMap<super::Iter<'a, u8>, ascii::EscapeDefault, EscapeByte>,
10099
}
101100

102-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
101+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
103102
impl<'a> iter::Iterator for EscapeAscii<'a> {
104103
type Item = u8;
105104
#[inline]
@@ -131,23 +130,23 @@ impl<'a> iter::Iterator for EscapeAscii<'a> {
131130
}
132131
}
133132

134-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
133+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
135134
impl<'a> iter::DoubleEndedIterator for EscapeAscii<'a> {
136135
fn next_back(&mut self) -> Option<u8> {
137136
self.inner.next_back()
138137
}
139138
}
140-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
139+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
141140
impl<'a> iter::ExactSizeIterator for EscapeAscii<'a> {}
142-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
141+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
143142
impl<'a> iter::FusedIterator for EscapeAscii<'a> {}
144-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
143+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
145144
impl<'a> fmt::Display for EscapeAscii<'a> {
146145
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
147146
self.clone().try_for_each(|b| f.write_char(b as char))
148147
}
149148
}
150-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
149+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
151150
impl<'a> fmt::Debug for EscapeAscii<'a> {
152151
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
153152
f.debug_struct("EscapeAscii").finish_non_exhaustive()

library/core/src/slice/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub use index::SliceIndex;
8181
#[unstable(feature = "slice_range", issue = "76393")]
8282
pub use index::range;
8383

84-
#[unstable(feature = "inherent_ascii_escape", issue = "77174")]
84+
#[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
8585
pub use ascii::EscapeAscii;
8686

8787
/// Calculates the direction and split point of a one-sided range.

0 commit comments

Comments
 (0)