diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 51c56d777a751..e782414c62a0a 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -1,6 +1,7 @@ // tidy-alphabetical-start #![allow(internal_features)] #![cfg_attr(bootstrap, feature(result_option_map_or_default))] +#![cfg_attr(bootstrap, feature(strip_circumfix))] #![feature(error_iter)] #![feature(file_buffered)] #![feature(gen_blocks)] @@ -8,7 +9,6 @@ #![feature(min_specialization)] #![feature(never_type)] #![feature(proc_macro_internals)] -#![feature(strip_circumfix)] #![feature(trusted_len)] // tidy-alphabetical-end diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 9f1bfc018f3a2..8900687036d41 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -11,6 +11,7 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(strip_circumfix))] #![feature(associated_type_defaults)] #![feature(default_field_values)] #![feature(deref_patterns)] @@ -18,7 +19,6 @@ #![feature(iter_intersperse)] #![feature(iterator_try_reduce)] #![feature(never_type)] -#![feature(strip_circumfix)] #![feature(try_blocks)] #![feature(unwrap_infallible)] #![feature(yeet_expr)] diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index ae6cc46a22a84..ede5985a4211a 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -2744,8 +2744,6 @@ impl [T] { /// # Examples /// /// ``` - /// #![feature(strip_circumfix)] - /// /// let v = &[10, 50, 40, 30]; /// assert_eq!(v.strip_circumfix(&[10], &[30]), Some(&[50, 40][..])); /// assert_eq!(v.strip_circumfix(&[10], &[40, 30]), Some(&[50][..])); @@ -2756,7 +2754,7 @@ impl [T] { /// assert_eq!(v.strip_circumfix(&[10, 50], &[]), Some(&[40, 30][..])); /// ``` #[must_use = "returns the subslice without modifying the original"] - #[unstable(feature = "strip_circumfix", issue = "147946")] + #[stable(feature = "strip_circumfix", since = "CURRENT_RUSTC_VERSION")] pub fn strip_circumfix(&self, prefix: &P, suffix: &S) -> Option<&[T]> where T: PartialEq, diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 9be44cd89de5e..68cdb69059f05 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -2510,15 +2510,13 @@ impl str { /// # Examples /// /// ``` - /// #![feature(strip_circumfix)] - /// /// assert_eq!("bar:hello:foo".strip_circumfix("bar:", ":foo"), Some("hello")); /// assert_eq!("bar:foo".strip_circumfix("foo", "foo"), None); /// assert_eq!("foo:bar;".strip_circumfix("foo:", ';'), Some("bar")); /// ``` #[must_use = "this returns the remaining substring as a new slice, \ without modifying the original"] - #[unstable(feature = "strip_circumfix", issue = "147946")] + #[stable(feature = "strip_circumfix", since = "CURRENT_RUSTC_VERSION")] pub fn strip_circumfix(&self, prefix: P, suffix: S) -> Option<&str> where for<'a> S::Searcher<'a>: ReverseSearcher<'a>,