diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs index 170750461cace..1480ab2513378 100644 --- a/compiler/rustc_codegen_cranelift/src/lib.rs +++ b/compiler/rustc_codegen_cranelift/src/lib.rs @@ -5,8 +5,7 @@ associated_type_bounds, never_type, try_blocks, - hash_drain_filter, - str_split_once + hash_drain_filter )] #![warn(rust_2018_idioms)] #![warn(unused_lifetimes)] diff --git a/compiler/rustc_mir/src/lib.rs b/compiler/rustc_mir/src/lib.rs index 8b3881ef9de10..508510a81e1fb 100644 --- a/compiler/rustc_mir/src/lib.rs +++ b/compiler/rustc_mir/src/lib.rs @@ -28,7 +28,6 @@ Rust MIR: a lowered representation of Rust. #![feature(or_patterns)] #![feature(once_cell)] #![feature(control_flow_enum)] -#![feature(str_split_once)] #![recursion_limit = "256"] #[macro_use] diff --git a/compiler/rustc_session/src/lib.rs b/compiler/rustc_session/src/lib.rs index 36bf8634c6eec..d002f59739166 100644 --- a/compiler/rustc_session/src/lib.rs +++ b/compiler/rustc_session/src/lib.rs @@ -1,7 +1,6 @@ #![feature(crate_visibility_modifier)] #![feature(once_cell)] #![feature(or_patterns)] -#![feature(str_split_once)] #[macro_use] extern crate bitflags; diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 4b03d38ccba5b..4dce029e86b50 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -22,7 +22,6 @@ #![feature(nll)] #![feature(min_specialization)] #![feature(option_expect_none)] -#![feature(str_split_once)] #[macro_use] extern crate rustc_macros; diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index 1ad57582ebafb..fb747dfcbd337 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -15,7 +15,6 @@ #![feature(never_type)] #![feature(associated_type_bounds)] #![feature(exhaustive_patterns)] -#![feature(str_split_once)] #[macro_use] extern crate rustc_macros; diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs index dd98f806451d8..9c92d96dc7059 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloc/tests/lib.rs @@ -6,7 +6,6 @@ #![feature(exact_size_is_empty)] #![feature(new_uninit)] #![feature(pattern)] -#![feature(str_split_once)] #![feature(trusted_len)] #![feature(try_reserve)] #![feature(unboxed_closures)] diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 6a35378ca7b50..50ccc2a2eaba1 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -1506,13 +1506,11 @@ impl str { /// # Examples /// /// ``` - /// #![feature(str_split_once)] - /// /// assert_eq!("cfg".split_once('='), None); /// assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo"))); /// assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar"))); /// ``` - #[unstable(feature = "str_split_once", reason = "newly added", issue = "74773")] + #[stable(feature = "str_split_once", since = "1.52.0")] #[inline] pub fn split_once<'a, P: Pattern<'a>>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)> { let (start, end) = delimiter.into_searcher(self).next_match()?; @@ -1525,13 +1523,11 @@ impl str { /// # Examples /// /// ``` - /// #![feature(str_split_once)] - /// /// assert_eq!("cfg".rsplit_once('='), None); /// assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo"))); /// assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar"))); /// ``` - #[unstable(feature = "str_split_once", reason = "newly added", issue = "74773")] + #[stable(feature = "str_split_once", since = "1.52.0")] #[inline] pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)> where diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 32aca8c83924d..63b65d8b41383 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -314,7 +314,6 @@ #![feature(stdsimd)] #![feature(stmt_expr_attributes)] #![feature(str_internals)] -#![feature(str_split_once)] #![feature(test)] #![feature(thread_local)] #![feature(thread_local_internals)] diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs index f9e65be9b0d40..3415eaa9fb345 100644 --- a/library/test/src/lib.rs +++ b/library/test/src/lib.rs @@ -31,7 +31,6 @@ #![feature(termination_trait_lib)] #![feature(test)] #![feature(total_cmp)] -#![feature(str_split_once)] // Public reexports pub use self::bench::{black_box, Bencher}; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index d7978c4a0228d..2342ed3ab670d 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -14,7 +14,6 @@ #![feature(never_type)] #![feature(once_cell)] #![feature(type_ascription)] -#![feature(str_split_once)] #![feature(iter_intersperse)] #![recursion_limit = "256"] #![deny(rustc::internal)] diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 1ab3aead966db..01e067ea0b803 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -14,7 +14,7 @@ //! A few exceptions are allowed as there's known bugs in rustdoc, but this //! should catch the majority of "broken link" cases. -#![feature(str_split_once)] +#![cfg_attr(bootstrap, feature(str_split_once))] use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet}; diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs index 27972c4992442..11d36751f67bb 100644 --- a/src/tools/tidy/src/lib.rs +++ b/src/tools/tidy/src/lib.rs @@ -3,7 +3,7 @@ //! This library contains the tidy lints and exposes it //! to be used by tools. -#![feature(str_split_once)] +#![cfg_attr(bootstrap, feature(str_split_once))] use std::fs::File; use std::io::Read;