From 7d9c4155a20a1e23e48717e1de84784105a71cc6 Mon Sep 17 00:00:00 2001 From: malezjaa Date: Mon, 5 Oct 2026 17:53:58 +0200 Subject: [PATCH] stabilize String::into_chars --- library/alloc/src/string.rs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 03c07b15712bb..3e6c8e32e9f4f 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2058,8 +2058,6 @@ impl String { /// Basic usage: /// /// ``` - /// #![feature(string_into_chars)] - /// /// let word = String::from("goodbye"); /// /// let mut chars = word.into_chars(); @@ -2078,8 +2076,6 @@ impl String { /// Remember, [`char`]s might not match your intuition about characters: /// /// ``` - /// #![feature(string_into_chars)] - /// /// let y = String::from("y̆"); /// /// let mut chars = y.into_chars(); @@ -2093,7 +2089,7 @@ impl String { /// [`char`]: prim@char #[inline] #[must_use = "`self` will be dropped if the result is not used"] - #[unstable(feature = "string_into_chars", issue = "133125")] + #[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] pub fn into_chars(self) -> IntoChars { IntoChars { bytes: self.into_bytes().into_iter() } } @@ -3439,12 +3435,12 @@ impl fmt::Write for String { /// [`into_chars`]: String::into_chars #[cfg_attr(not(no_global_oom_handling), derive(Clone))] #[must_use = "iterators are lazy and do nothing unless consumed"] -#[unstable(feature = "string_into_chars", issue = "133125")] +#[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] pub struct IntoChars { bytes: vec::IntoIter, } -#[unstable(feature = "string_into_chars", issue = "133125")] +#[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for IntoChars { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("IntoChars").field(&self.as_str()).finish() @@ -3457,8 +3453,6 @@ impl IntoChars { /// # Examples /// /// ``` - /// #![feature(string_into_chars)] - /// /// let mut chars = String::from("abc").into_chars(); /// /// assert_eq!(chars.as_str(), "abc"); @@ -3468,7 +3462,7 @@ impl IntoChars { /// chars.next(); /// assert_eq!(chars.as_str(), ""); /// ``` - #[unstable(feature = "string_into_chars", issue = "133125")] + #[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] #[must_use] #[inline] pub fn as_str(&self) -> &str { @@ -3481,8 +3475,6 @@ impl IntoChars { /// # Examples /// /// ``` - /// #![feature(string_into_chars)] - /// /// let chars = String::from("abc").into_chars(); /// assert_eq!(chars.into_string(), "abc"); /// @@ -3491,7 +3483,7 @@ impl IntoChars { /// assert_eq!(chars.into_string(), "ef"); /// ``` #[cfg(not(no_global_oom_handling))] - #[unstable(feature = "string_into_chars", issue = "133125")] + #[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] #[inline] pub fn into_string(self) -> String { // SAFETY: `bytes` are kept in UTF-8 form, only removing whole `char`s at a time. @@ -3504,7 +3496,7 @@ impl IntoChars { } } -#[unstable(feature = "string_into_chars", issue = "133125")] +#[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] impl Iterator for IntoChars { type Item = char; @@ -3538,7 +3530,7 @@ impl Iterator for IntoChars { } } -#[unstable(feature = "string_into_chars", issue = "133125")] +#[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] impl DoubleEndedIterator for IntoChars { #[inline] fn next_back(&mut self) -> Option { @@ -3555,7 +3547,7 @@ impl DoubleEndedIterator for IntoChars { } } -#[unstable(feature = "string_into_chars", issue = "133125")] +#[stable(feature = "string_into_chars", since = "CURRENT_RUSTC_VERSION")] impl FusedIterator for IntoChars {} /// A draining iterator for `String`.