Stabilize is_some_and

This commit is contained in:
Jonas Platte 2023-04-06 21:54:05 +02:00
parent f5b8f44e5d
commit 443928f7e3
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
7 changed files with 3 additions and 13 deletions

View File

@ -7,7 +7,6 @@
#![feature(box_patterns)]
#![feature(decl_macro)]
#![feature(if_let_guard)]
#![feature(is_some_and)]
#![feature(is_sorted)]
#![feature(let_chains)]
#![feature(proc_macro_internals)]

View File

@ -20,7 +20,6 @@ Rust MIR: a lowered representation of Rust.
#![feature(try_blocks)]
#![feature(yeet_expr)]
#![feature(if_let_guard)]
#![feature(is_some_and)]
#![recursion_limit = "256"]
#[macro_use]

View File

@ -70,7 +70,6 @@ This API is completely unstable and subject to change.
#![feature(lazy_cell)]
#![feature(slice_partition_dedup)]
#![feature(try_blocks)]
#![feature(is_some_and)]
#![feature(type_alias_impl_trait)]
#![recursion_limit = "256"]

View File

@ -605,8 +605,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```
/// #![feature(is_some_and)]
///
/// let x: Option<u32> = Some(2);
/// assert_eq!(x.is_some_and(|x| x > 1), true);
///
@ -618,7 +616,7 @@ impl<T> Option<T> {
/// ```
#[must_use]
#[inline]
#[unstable(feature = "is_some_and", issue = "93050")]
#[stable(feature = "is_some_and", since = "CURRENT_RUSTC_VERSION")]
pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
match self {
None => false,

View File

@ -545,8 +545,6 @@ impl<T, E> Result<T, E> {
/// # Examples
///
/// ```
/// #![feature(is_some_and)]
///
/// let x: Result<u32, &str> = Ok(2);
/// assert_eq!(x.is_ok_and(|x| x > 1), true);
///
@ -558,7 +556,7 @@ impl<T, E> Result<T, E> {
/// ```
#[must_use]
#[inline]
#[unstable(feature = "is_some_and", issue = "93050")]
#[stable(feature = "is_some_and", since = "CURRENT_RUSTC_VERSION")]
pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool {
match self {
Err(_) => false,
@ -590,7 +588,6 @@ impl<T, E> Result<T, E> {
/// # Examples
///
/// ```
/// #![feature(is_some_and)]
/// use std::io::{Error, ErrorKind};
///
/// let x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));
@ -604,7 +601,7 @@ impl<T, E> Result<T, E> {
/// ```
#[must_use]
#[inline]
#[unstable(feature = "is_some_and", issue = "93050")]
#[stable(feature = "is_some_and", since = "CURRENT_RUSTC_VERSION")]
pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool {
match self {
Ok(_) => false,

View File

@ -289,7 +289,6 @@
#![feature(hashmap_internals)]
#![feature(ip)]
#![feature(ip_in_core)]
#![feature(is_some_and)]
#![feature(maybe_uninit_slice)]
#![feature(maybe_uninit_write_slice)]
#![feature(panic_can_unwind)]

View File

@ -5,7 +5,6 @@
#![feature(io_error_more)]
#![feature(variant_count)]
#![feature(yeet_expr)]
#![feature(is_some_and)]
#![feature(nonzero_ops)]
#![feature(local_key_cell_methods)]
#![feature(is_terminal)]