From a6eebbe90526529f217199f09a3df233fc40b1f9 Mon Sep 17 00:00:00 2001 From: wr7 Date: Mon, 19 May 2025 18:34:48 -0600 Subject: [PATCH] Stabilize `substr_range` and related methods --- library/core/src/slice/mod.rs | 3 +-- library/core/src/str/mod.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index d3c37e3caf6ab..afe5c24eab16e 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -5296,7 +5296,6 @@ impl [T] { /// # Examples /// Basic usage: /// ``` - /// #![feature(substr_range)] /// use core::range::Range; /// /// let nums = &[0, 5, 10, 0, 0, 5]; @@ -5311,7 +5310,7 @@ impl [T] { /// assert_eq!(iter.next(), Some(Range { start: 5, end: 6 })); /// ``` #[must_use] - #[unstable(feature = "substr_range", issue = "126769")] + #[stable(feature = "substr_range", since = "CURRENT_RUSTC_VERSION")] pub fn subslice_range(&self, subslice: &[T]) -> Option> { if T::IS_ZST { panic!("elements are zero-sized"); diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 1a4493de30a1f..85e3bf030f4a9 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -3111,7 +3111,6 @@ impl str { /// /// # Examples /// ``` - /// #![feature(substr_range)] /// use core::range::Range; /// /// let data = "a, b, b, a"; @@ -3123,7 +3122,7 @@ impl str { /// assert_eq!(iter.next(), Some(Range { start: 9, end: 10 })); /// ``` #[must_use] - #[unstable(feature = "substr_range", issue = "126769")] + #[stable(feature = "substr_range", since = "CURRENT_RUSTC_VERSION")] pub fn substr_range(&self, substr: &str) -> Option> { self.as_bytes().subslice_range(substr.as_bytes()) }