From 138327244fcc81ecd42a6dc1a7c80dc3f9d2703a Mon Sep 17 00:00:00 2001 From: Zachary S Date: Wed, 13 Nov 2024 16:24:37 -0600 Subject: [PATCH] Const-stabilize `str::is_char_boundary` and `str::split_at(_mut)(_checked)`. --- library/core/src/str/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 8a473b398bb5f..e17cdea8384e2 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -185,7 +185,7 @@ impl str { /// ``` #[must_use] #[stable(feature = "is_char_boundary", since = "1.9.0")] - #[rustc_const_unstable(feature = "const_is_char_boundary", issue = "131516")] + #[rustc_const_stable(feature = "const_is_char_boundary", since = "CURRENT_RUSTC_VERSION")] #[inline] pub const fn is_char_boundary(&self, index: usize) -> bool { // 0 is always ok. @@ -642,7 +642,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "str_split_at", since = "1.4.0")] - #[rustc_const_unstable(feature = "const_str_split_at", issue = "131518")] + #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] pub const fn split_at(&self, mid: usize) -> (&str, &str) { match self.split_at_checked(mid) { None => slice_error_fail(self, 0, mid), @@ -683,7 +683,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "str_split_at", since = "1.4.0")] - #[rustc_const_unstable(feature = "const_str_split_at", issue = "131518")] + #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] pub const fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) { // is_char_boundary checks that the index is in [0, .len()] if self.is_char_boundary(mid) { @@ -723,7 +723,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "split_at_checked", since = "1.80.0")] - #[rustc_const_unstable(feature = "const_str_split_at", issue = "131518")] + #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] pub const fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)> { // is_char_boundary checks that the index is in [0, .len()] if self.is_char_boundary(mid) { @@ -764,7 +764,7 @@ impl str { #[inline] #[must_use] #[stable(feature = "split_at_checked", since = "1.80.0")] - #[rustc_const_unstable(feature = "const_str_split_at", issue = "131518")] + #[rustc_const_stable(feature = "const_str_split_at", since = "CURRENT_RUSTC_VERSION")] pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut str, &mut str)> { // is_char_boundary checks that the index is in [0, .len()] if self.is_char_boundary(mid) {