1
Fork 0

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(box_patterns)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(is_some_and)]
#![feature(is_sorted)] #![feature(is_sorted)]
#![feature(let_chains)] #![feature(let_chains)]
#![feature(proc_macro_internals)] #![feature(proc_macro_internals)]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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