Skip to content

Commit b6f6104

Browse files
committed
Auto merge of #110019 - jplatte:jplatte/stabilize-is-some-and, r=Amanieu
Stabilize is_some_and This stabilizes the following public API: ```rust impl<T> Option<T> { pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool; } impl<T, E> Result<T, E> { pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool; pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool; } ``` Closes #93050 (tracking issue). `@rustbot` label +T-libs-api -T-libs
2 parents 97879ce + 443928f commit b6f6104

File tree

7 files changed

+3
-13
lines changed

7 files changed

+3
-13
lines changed

compiler/rustc_builtin_macros/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#![feature(box_patterns)]
88
#![feature(decl_macro)]
99
#![feature(if_let_guard)]
10-
#![feature(is_some_and)]
1110
#![feature(is_sorted)]
1211
#![feature(let_chains)]
1312
#![feature(proc_macro_internals)]

compiler/rustc_const_eval/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Rust MIR: a lowered representation of Rust.
2020
#![feature(try_blocks)]
2121
#![feature(yeet_expr)]
2222
#![feature(if_let_guard)]
23-
#![feature(is_some_and)]
2423
#![recursion_limit = "256"]
2524

2625
#[macro_use]

compiler/rustc_hir_analysis/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ This API is completely unstable and subject to change.
7070
#![feature(lazy_cell)]
7171
#![feature(slice_partition_dedup)]
7272
#![feature(try_blocks)]
73-
#![feature(is_some_and)]
7473
#![feature(type_alias_impl_trait)]
7574
#![recursion_limit = "256"]
7675

library/core/src/option.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,6 @@ impl<T> Option<T> {
605605
/// # Examples
606606
///
607607
/// ```
608-
/// #![feature(is_some_and)]
609-
///
610608
/// let x: Option<u32> = Some(2);
611609
/// assert_eq!(x.is_some_and(|x| x > 1), true);
612610
///
@@ -618,7 +616,7 @@ impl<T> Option<T> {
618616
/// ```
619617
#[must_use]
620618
#[inline]
621-
#[unstable(feature = "is_some_and", issue = "93050")]
619+
#[stable(feature = "is_some_and", since = "CURRENT_RUSTC_VERSION")]
622620
pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
623621
match self {
624622
None => false,

library/core/src/result.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,6 @@ impl<T, E> Result<T, E> {
545545
/// # Examples
546546
///
547547
/// ```
548-
/// #![feature(is_some_and)]
549-
///
550548
/// let x: Result<u32, &str> = Ok(2);
551549
/// assert_eq!(x.is_ok_and(|x| x > 1), true);
552550
///
@@ -558,7 +556,7 @@ impl<T, E> Result<T, E> {
558556
/// ```
559557
#[must_use]
560558
#[inline]
561-
#[unstable(feature = "is_some_and", issue = "93050")]
559+
#[stable(feature = "is_some_and", since = "CURRENT_RUSTC_VERSION")]
562560
pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool {
563561
match self {
564562
Err(_) => false,
@@ -590,7 +588,6 @@ impl<T, E> Result<T, E> {
590588
/// # Examples
591589
///
592590
/// ```
593-
/// #![feature(is_some_and)]
594591
/// use std::io::{Error, ErrorKind};
595592
///
596593
/// let x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));
@@ -604,7 +601,7 @@ impl<T, E> Result<T, E> {
604601
/// ```
605602
#[must_use]
606603
#[inline]
607-
#[unstable(feature = "is_some_and", issue = "93050")]
604+
#[stable(feature = "is_some_and", since = "CURRENT_RUSTC_VERSION")]
608605
pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool {
609606
match self {
610607
Ok(_) => false,

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@
289289
#![feature(hashmap_internals)]
290290
#![feature(ip)]
291291
#![feature(ip_in_core)]
292-
#![feature(is_some_and)]
293292
#![feature(maybe_uninit_slice)]
294293
#![feature(maybe_uninit_write_slice)]
295294
#![feature(panic_can_unwind)]

src/tools/miri/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(io_error_more)]
66
#![feature(variant_count)]
77
#![feature(yeet_expr)]
8-
#![feature(is_some_and)]
98
#![feature(nonzero_ops)]
109
#![feature(local_key_cell_methods)]
1110
#![feature(is_terminal)]

0 commit comments

Comments
 (0)