Skip to content
Open
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_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(trim_prefix_suffix))]
#![feature(extern_types)]
#![feature(file_buffered)]
#![feature(impl_trait_in_assoc_type)]
#![feature(iter_intersperse)]
#![feature(macro_derive)]
#![feature(once_cell_try)]
#![feature(trim_prefix_suffix)]
#![feature(try_blocks)]
// tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
//! This API is completely unstable and subject to change.

// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(trim_prefix_suffix))]
#![feature(decl_macro)]
#![feature(file_buffered)]
#![feature(panic_backtrace_config)]
#![feature(panic_update_hook)]
#![feature(trim_prefix_suffix)]
#![feature(try_blocks)]
// tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(trim_prefix_suffix))]
#![feature(deref_patterns)]
#![feature(iter_intersperse)]
#![feature(iter_order_by)]
#![feature(never_type)]
#![feature(option_into_flat_iter)]
#![feature(option_reference_flattening)]
#![feature(trim_prefix_suffix)]
// tidy-alphabetical-end

mod _match;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(trim_prefix_suffix))]
#![feature(arbitrary_self_types)]
#![feature(const_default)]
#![feature(const_trait_impl)]
Expand All @@ -17,7 +18,6 @@
#![feature(iter_intersperse)]
#![feature(option_into_flat_iter)]
#![feature(rustc_attrs)]
#![feature(trim_prefix_suffix)]
#![recursion_limit = "256"]
// tidy-alphabetical-end

Expand Down
8 changes: 2 additions & 6 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2784,8 +2784,6 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// #![feature(trim_prefix_suffix)]
///
/// let v = &[10, 40, 30];
///
/// // Prefix present - removes it
Expand All @@ -2801,7 +2799,7 @@ impl<T> [T] {
/// assert_eq!(b"hello".trim_prefix(prefix.as_bytes()), b"llo".as_ref());
/// ```
#[must_use = "returns the subslice without modifying the original"]
#[unstable(feature = "trim_prefix_suffix", issue = "142312")]
#[stable(feature = "trim_prefix_suffix", since = "CURRENT_RUSTC_VERSION")]
pub fn trim_prefix<P: SlicePattern<Item = T> + ?Sized>(&self, prefix: &P) -> &[T]
where
T: PartialEq,
Expand All @@ -2827,8 +2825,6 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// #![feature(trim_prefix_suffix)]
///
/// let v = &[10, 40, 30];
///
/// // Suffix present - removes it
Expand All @@ -2841,7 +2837,7 @@ impl<T> [T] {
/// assert_eq!(v.trim_suffix(&[50, 30]), &[10, 40, 30][..]);
/// ```
#[must_use = "returns the subslice without modifying the original"]
#[unstable(feature = "trim_prefix_suffix", issue = "142312")]
#[stable(feature = "trim_prefix_suffix", since = "CURRENT_RUSTC_VERSION")]
pub fn trim_suffix<P: SlicePattern<Item = T> + ?Sized>(&self, suffix: &P) -> &[T]
where
T: PartialEq,
Expand Down
8 changes: 2 additions & 6 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2545,8 +2545,6 @@ impl str {
/// # Examples
///
/// ```
/// #![feature(trim_prefix_suffix)]
///
/// // Prefix present - removes it
/// assert_eq!("foo:bar".trim_prefix("foo:"), "bar");
/// assert_eq!("foofoo".trim_prefix("foo"), "foo");
Expand All @@ -2559,7 +2557,7 @@ impl str {
/// ```
#[must_use = "this returns the remaining substring as a new slice, \
without modifying the original"]
#[unstable(feature = "trim_prefix_suffix", issue = "142312")]
#[stable(feature = "trim_prefix_suffix", since = "CURRENT_RUSTC_VERSION")]
pub fn trim_prefix<P: Pattern>(&self, prefix: P) -> &str {
prefix.strip_prefix_of(self).unwrap_or(self)
}
Expand All @@ -2582,8 +2580,6 @@ impl str {
/// # Examples
///
/// ```
/// #![feature(trim_prefix_suffix)]
///
/// // Suffix present - removes it
/// assert_eq!("bar:foo".trim_suffix(":foo"), "bar");
/// assert_eq!("foofoo".trim_suffix("foo"), "foo");
Expand All @@ -2596,7 +2592,7 @@ impl str {
/// ```
#[must_use = "this returns the remaining substring as a new slice, \
without modifying the original"]
#[unstable(feature = "trim_prefix_suffix", issue = "142312")]
#[stable(feature = "trim_prefix_suffix", since = "CURRENT_RUSTC_VERSION")]
pub fn trim_suffix<P: Pattern>(&self, suffix: P) -> &str
where
for<'a> P::Searcher<'a>: ReverseSearcher<'a>,
Expand Down
3 changes: 1 addition & 2 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2752,7 +2752,6 @@ impl Path {
/// # Examples
///
/// ```
/// #![feature(trim_prefix_suffix)]
/// use std::path::Path;
///
/// let path = Path::new("/test/haha/foo.txt");
Expand All @@ -2770,7 +2769,7 @@ impl Path {
/// assert_eq!(path.trim_prefix("/haha"), path);
/// ```
#[must_use = "this returns the remaining path as a new path, without modifying the original"]
#[unstable(feature = "trim_prefix_suffix", issue = "142312")]
#[stable(feature = "trim_prefix_suffix", since = "CURRENT_RUSTC_VERSION")]
pub fn trim_prefix<P>(&self, base: P) -> &Path
where
P: AsRef<Path>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(trim_prefix_suffix))]
#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/"
Expand All @@ -12,7 +13,6 @@
#![feature(iter_order_by)]
#![feature(rustc_private)]
#![feature(test)]
#![feature(trim_prefix_suffix)]
#![feature(variant_count)]
#![recursion_limit = "256"]
#![warn(rustc::internal)]
Expand Down
Loading