Skip to content

Commit 0639855

Browse files
committed
Stabilize str_as_str
1 parent 021fc25 commit 0639855

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

‎library/alloctests/tests/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#![feature(thin_box)]
3737
#![feature(drain_keep_rest)]
3838
#![feature(local_waker)]
39-
#![feature(str_as_str)]
4039
#![feature(strict_provenance_lints)]
4140
#![feature(string_replace_in_place)]
4241
#![feature(vec_deque_truncate_front)]

‎library/core/src/bstr/mod.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ impl ByteStr {
7474
/// it helps dereferencing other "container" types,
7575
/// for example `Box<ByteStr>` or `Arc<ByteStr>`.
7676
#[inline]
77-
// #[unstable(feature = "str_as_str", issue = "130366")]
7877
#[unstable(feature = "bstr", issue = "134915")]
7978
pub const fn as_byte_str(&self) -> &ByteStr {
8079
self
@@ -86,7 +85,6 @@ impl ByteStr {
8685
/// it helps dereferencing other "container" types,
8786
/// for example `Box<ByteStr>` or `MutexGuard<ByteStr>`.
8887
#[inline]
89-
// #[unstable(feature = "str_as_str", issue = "130366")]
9088
#[unstable(feature = "bstr", issue = "134915")]
9189
pub const fn as_mut_byte_str(&mut self) -> &mut ByteStr {
9290
self

‎library/core/src/ffi/c_str.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,8 @@ impl CStr {
655655
/// it helps dereferencing other string-like types to string slices,
656656
/// for example references to `Box<CStr>` or `Arc<CStr>`.
657657
#[inline]
658-
#[unstable(feature = "str_as_str", issue = "130366")]
658+
#[stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
659+
#[rustc_const_stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
659660
pub const fn as_c_str(&self) -> &CStr {
660661
self
661662
}

‎library/core/src/slice/mod.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5126,7 +5126,8 @@ impl<T> [T] {
51265126
/// it helps dereferencing other "container" types to slices,
51275127
/// for example `Box<[T]>` or `Arc<[T]>`.
51285128
#[inline]
5129-
#[unstable(feature = "str_as_str", issue = "130366")]
5129+
#[stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
5130+
#[rustc_const_stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
51305131
pub const fn as_slice(&self) -> &[T] {
51315132
self
51325133
}
@@ -5137,7 +5138,8 @@ impl<T> [T] {
51375138
/// it helps dereferencing other "container" types to slices,
51385139
/// for example `Box<[T]>` or `MutexGuard<[T]>`.
51395140
#[inline]
5140-
#[unstable(feature = "str_as_str", issue = "130366")]
5141+
#[stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
5142+
#[rustc_const_stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
51415143
pub const fn as_mut_slice(&mut self) -> &mut [T] {
51425144
self
51435145
}

‎library/core/src/str/mod.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,8 @@ impl str {
31213121
/// it helps dereferencing other string-like types to string slices,
31223122
/// for example references to `Box<str>` or `Arc<str>`.
31233123
#[inline]
3124-
#[unstable(feature = "str_as_str", issue = "130366")]
3124+
#[stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
3125+
#[rustc_const_stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
31253126
pub const fn as_str(&self) -> &str {
31263127
self
31273128
}

‎library/std/src/ffi/os_str.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,8 @@ impl OsStr {
12851285
/// it helps dereferencing other string-like types to string slices,
12861286
/// for example references to `Box<OsStr>` or `Arc<OsStr>`.
12871287
#[inline]
1288-
#[unstable(feature = "str_as_str", issue = "130366")]
1288+
#[stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
1289+
#[rustc_const_stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
12891290
pub const fn as_os_str(&self) -> &OsStr {
12901291
self
12911292
}

‎library/std/src/path.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3221,7 +3221,8 @@ impl Path {
32213221
/// it helps dereferencing other `PathBuf`-like types to `Path`s,
32223222
/// for example references to `Box<Path>` or `Arc<Path>`.
32233223
#[inline]
3224-
#[unstable(feature = "str_as_str", issue = "130366")]
3224+
#[stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
3225+
#[rustc_const_stable(feature = "str_as_str", since = "CURRENT_RUSTC_VERSION")]
32253226
pub const fn as_path(&self) -> &Path {
32263227
self
32273228
}

0 commit comments

Comments
 (0)