Skip to content

Commit

Permalink
library: Stabilize const_str_from_utf8_unchecked_mut
Browse files Browse the repository at this point in the history
Const-stabilizes:
- `str::from_utf8_unchecked_mut`
  • Loading branch information
workingjubilee committed Oct 2, 2024
1 parent 7a5052a commit 78ad293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 4 additions & 1 deletion core/src/str/converts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
#[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`
Expand Down

0 comments on commit 78ad293

Please sign in to comment.