From fe7487a79e5ee716f421b66a164e9bab3862e5e7 Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Fri, 11 Jun 2021 01:55:47 -0400 Subject: [PATCH] Stabilize `str::from_utf8_unchecked` as `const` --- library/core/src/str/converts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/str/converts.rs b/library/core/src/str/converts.rs index 05ff7bb120dae..a51d142074822 100644 --- a/library/core/src/str/converts.rs +++ b/library/core/src/str/converts.rs @@ -156,7 +156,7 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature = "const_str_from_utf8_unchecked", issue = "75196")] +#[rustc_const_stable(feature = "const_str_from_utf8_unchecked", since = "1.55.0")] #[rustc_allow_const_fn_unstable(const_fn_transmute)] pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str { // SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.