library: Stabilize const_str_from_utf8_unchecked_mut

Const-stabilizes:
- `str::from_utf8_unchecked_mut`
This commit is contained in:
Jubilee Young 2024-09-27 13:17:27 -07:00
parent e6eb45143c
commit a0228686d1
2 changed files with 4 additions and 2 deletions

View File

@ -152,7 +152,6 @@
#![feature(const_slice_from_ref)]
#![feature(const_slice_split_at_mut)]
#![feature(const_str_as_mut)]
#![feature(const_str_from_utf8_unchecked_mut)]
#![feature(const_strict_overflow_ops)]
#![feature(const_swap)]
#![feature(const_try)]

View File

@ -195,7 +195,10 @@ pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
#[inline]
#[must_use]
#[stable(feature = "str_mut_extras", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_str_from_utf8_unchecked_mut", issue = "91005")]
#[rustc_const_stable(
feature = "const_str_from_utf8_unchecked_mut",
since = "CURRENT_RUSTC_VERSION"
)]
#[rustc_diagnostic_item = "str_from_utf8_unchecked_mut"]
pub const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
// SAFETY: the caller must guarantee that the bytes `v`