Skip to content

Commit 3bf9c33

Browse files
tgross35gitbot
authored and
gitbot
committed
Rollup merge of rust-lang#136668 - WaffleLapkin:from_utf8_mut, r=Amanieu
Stabilize `core::str::from_utf8_mut` as `const` cc rust-lang#91006 (tracking issue) r? libs-api
2 parents 8eba2b6 + de8f767 commit 3bf9c33

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

alloc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![feature(string_remove_matches)]
3030
#![feature(const_btree_len)]
3131
#![feature(const_trait_impl)]
32-
#![feature(const_str_from_utf8)]
3332
#![feature(panic_update_hook)]
3433
#![feature(pointer_is_aligned_to)]
3534
#![feature(test)]

core/src/str/converts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub const fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
126126
/// See the docs for [`Utf8Error`] for more details on the kinds of
127127
/// errors that can be returned.
128128
#[stable(feature = "str_mut_extras", since = "1.20.0")]
129-
#[rustc_const_unstable(feature = "const_str_from_utf8", issue = "91006")]
129+
#[rustc_const_stable(feature = "const_str_from_utf8", since = "CURRENT_RUSTC_VERSION")]
130130
#[rustc_diagnostic_item = "str_from_utf8_mut"]
131131
pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
132132
// FIXME(const-hack): This should use `?` again, once it's `const`

core/src/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl str {
265265
/// See the docs for [`Utf8Error`] for more details on the kinds of
266266
/// errors that can be returned.
267267
#[stable(feature = "inherent_str_constructors", since = "CURRENT_RUSTC_VERSION")]
268-
#[rustc_const_unstable(feature = "const_str_from_utf8", issue = "91006")]
268+
#[rustc_const_stable(feature = "const_str_from_utf8", since = "CURRENT_RUSTC_VERSION")]
269269
#[rustc_diagnostic_item = "str_inherent_from_utf8_mut"]
270270
pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
271271
converts::from_utf8_mut(v)

0 commit comments

Comments
 (0)