about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-04 11:56:55 +0000
committerbors <bors@rust-lang.org>2021-07-04 11:56:55 +0000
commit308fc2322bf00b5dc12454489679de1420320f56 (patch)
tree6ff4d859bce9fbfa7f0cc7af6710a3d1eb243ce0
parent39e20f1ae5f13451eb35247808d6a2527cb7d060 (diff)
parentfe7487a79e5ee716f421b66a164e9bab3862e5e7 (diff)
downloadrust-308fc2322bf00b5dc12454489679de1420320f56.tar.gz
rust-308fc2322bf00b5dc12454489679de1420320f56.zip
Auto merge of #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 #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 #75196
-rw-r--r--library/core/src/str/converts.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/str/converts.rs b/library/core/src/str/converts.rs
index 05ff7bb120d..a51d1420748 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.