Stabilize str_split_once

This commit is contained in:
Jacob Pratt 2021-02-09 17:30:37 -05:00
parent 097bc6a84f
commit c28f2a8bee
No known key found for this signature in database
GPG Key ID: B80E19E4662B5AA4
12 changed files with 5 additions and 18 deletions

View File

@ -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)]

View File

@ -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]

View File

@ -1,7 +1,6 @@
#![feature(crate_visibility_modifier)]
#![feature(once_cell)]
#![feature(or_patterns)]
#![feature(str_split_once)]
#[macro_use]
extern crate bitflags;

View File

@ -22,7 +22,6 @@
#![feature(nll)]
#![feature(min_specialization)]
#![feature(option_expect_none)]
#![feature(str_split_once)]
#[macro_use]
extern crate rustc_macros;

View File

@ -15,7 +15,6 @@
#![feature(never_type)]
#![feature(associated_type_bounds)]
#![feature(exhaustive_patterns)]
#![feature(str_split_once)]
#[macro_use]
extern crate rustc_macros;

View File

@ -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)]

View File

@ -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

View File

@ -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)]

View File

@ -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};

View File

@ -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)]

View File

@ -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};

View File

@ -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;