Skip to content

Commit 308fc23

Browse files
committed
Auto merge of rust-lang#86213 - jhpratt:stabilize-const-from_utf8_unchecked, r=JohnTitor
Stabilize `str::from_utf8_unchecked` as `const` This stabilizes `unsafe fn str::from_utf8_unchecked` as `const` pending FCP on rust-lang#75196. By the time FCP finishes, the beta will have already been cut, so I've set 1.55 as the stable-since version. (should also be +relnotes but I don't have the permission to do that) r? `@m-ou-se` Closes rust-lang#75196
2 parents 39e20f1 + fe7487a commit 308fc23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/str/converts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
156156
/// ```
157157
#[inline]
158158
#[stable(feature = "rust1", since = "1.0.0")]
159-
#[rustc_const_unstable(feature = "const_str_from_utf8_unchecked", issue = "75196")]
159+
#[rustc_const_stable(feature = "const_str_from_utf8_unchecked", since = "1.55.0")]
160160
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
161161
pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
162162
// SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.

0 commit comments

Comments
 (0)