Skip to content

Commit 0db8349

Browse files
Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-se
Stabilize str_split_once Closes #74773
2 parents d95d304 + c28f2a8 commit 0db8349

File tree

12 files changed

+5
-18
lines changed

12 files changed

+5
-18
lines changed

compiler/rustc_codegen_cranelift/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
associated_type_bounds,
66
never_type,
77
try_blocks,
8-
hash_drain_filter,
9-
str_split_once
8+
hash_drain_filter
109
)]
1110
#![warn(rust_2018_idioms)]
1211
#![warn(unused_lifetimes)]

compiler/rustc_mir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Rust MIR: a lowered representation of Rust.
2828
#![feature(or_patterns)]
2929
#![feature(once_cell)]
3030
#![feature(control_flow_enum)]
31-
#![feature(str_split_once)]
3231
#![recursion_limit = "256"]
3332

3433
#[macro_use]

compiler/rustc_session/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(crate_visibility_modifier)]
22
#![feature(once_cell)]
33
#![feature(or_patterns)]
4-
#![feature(str_split_once)]
54

65
#[macro_use]
76
extern crate bitflags;

compiler/rustc_span/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#![feature(nll)]
2323
#![feature(min_specialization)]
2424
#![feature(option_expect_none)]
25-
#![feature(str_split_once)]
2625

2726
#[macro_use]
2827
extern crate rustc_macros;

compiler/rustc_target/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(never_type)]
1616
#![feature(associated_type_bounds)]
1717
#![feature(exhaustive_patterns)]
18-
#![feature(str_split_once)]
1918

2019
#[macro_use]
2120
extern crate rustc_macros;

library/alloc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(exact_size_is_empty)]
77
#![feature(new_uninit)]
88
#![feature(pattern)]
9-
#![feature(str_split_once)]
109
#![feature(trusted_len)]
1110
#![feature(try_reserve)]
1211
#![feature(unboxed_closures)]

library/core/src/str/mod.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1506,13 +1506,11 @@ impl str {
15061506
/// # Examples
15071507
///
15081508
/// ```
1509-
/// #![feature(str_split_once)]
1510-
///
15111509
/// assert_eq!("cfg".split_once('='), None);
15121510
/// assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
15131511
/// assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
15141512
/// ```
1515-
#[unstable(feature = "str_split_once", reason = "newly added", issue = "74773")]
1513+
#[stable(feature = "str_split_once", since = "1.52.0")]
15161514
#[inline]
15171515
pub fn split_once<'a, P: Pattern<'a>>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)> {
15181516
let (start, end) = delimiter.into_searcher(self).next_match()?;
@@ -1525,13 +1523,11 @@ impl str {
15251523
/// # Examples
15261524
///
15271525
/// ```
1528-
/// #![feature(str_split_once)]
1529-
///
15301526
/// assert_eq!("cfg".rsplit_once('='), None);
15311527
/// assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
15321528
/// assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
15331529
/// ```
1534-
#[unstable(feature = "str_split_once", reason = "newly added", issue = "74773")]
1530+
#[stable(feature = "str_split_once", since = "1.52.0")]
15351531
#[inline]
15361532
pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>
15371533
where

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@
314314
#![feature(stdsimd)]
315315
#![feature(stmt_expr_attributes)]
316316
#![feature(str_internals)]
317-
#![feature(str_split_once)]
318317
#![feature(test)]
319318
#![feature(thread_local)]
320319
#![feature(thread_local_internals)]

library/test/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![feature(termination_trait_lib)]
3232
#![feature(test)]
3333
#![feature(total_cmp)]
34-
#![feature(str_split_once)]
3534

3635
// Public reexports
3736
pub use self::bench::{black_box, Bencher};

src/librustdoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![feature(never_type)]
1515
#![feature(once_cell)]
1616
#![feature(type_ascription)]
17-
#![feature(str_split_once)]
1817
#![feature(iter_intersperse)]
1918
#![recursion_limit = "256"]
2019
#![deny(rustc::internal)]

src/tools/linkchecker/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! A few exceptions are allowed as there's known bugs in rustdoc, but this
1515
//! should catch the majority of "broken link" cases.
1616
17-
#![feature(str_split_once)]
17+
#![cfg_attr(bootstrap, feature(str_split_once))]
1818

1919
use std::collections::hash_map::Entry;
2020
use std::collections::{HashMap, HashSet};

src/tools/tidy/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This library contains the tidy lints and exposes it
44
//! to be used by tools.
55
6-
#![feature(str_split_once)]
6+
#![cfg_attr(bootstrap, feature(str_split_once))]
77

88
use std::fs::File;
99
use std::io::Read;

0 commit comments

Comments
 (0)