Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// 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)]
#![feature(macro_metavar_expr)]
#![feature(min_specialization)]
#![feature(never_type)]
#![feature(proc_macro_internals)]
#![feature(strip_circumfix)]
#![feature(trusted_len)]
// tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
//! 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)]
#![feature(hash_set_entry)]
#![feature(iter_intersperse)]
#![feature(iterator_try_reduce)]
#![feature(never_type)]
#![feature(strip_circumfix)]
#![feature(try_blocks)]
#![feature(unwrap_infallible)]
#![feature(yeet_expr)]
Expand Down
4 changes: 1 addition & 3 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2744,8 +2744,6 @@ impl<T> [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][..]));
Expand All @@ -2756,7 +2754,7 @@ impl<T> [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<S, P>(&self, prefix: &P, suffix: &S) -> Option<&[T]>
where
T: PartialEq,
Expand Down
4 changes: 1 addition & 3 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<P: Pattern, S: Pattern>(&self, prefix: P, suffix: S) -> Option<&str>
where
for<'a> S::Searcher<'a>: ReverseSearcher<'a>,
Expand Down
Loading