about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-16 19:58:58 +0200
committerGitHub <noreply@github.com>2024-08-16 19:58:58 +0200
commit9d57e46f81ad82a729913f240bbaaf3aba94b2c7 (patch)
tree60d17c761143a61dec2162e9fabc8c08081372ca
parentf04d25fa91103a885d124e6e8384d92358847e0c (diff)
parent14ac0a38db036fbe3620534ee1c142f7092364e5 (diff)
downloadrust-9d57e46f81ad82a729913f240bbaaf3aba94b2c7.tar.gz
rust-9d57e46f81ad82a729913f240bbaaf3aba94b2c7.zip
Rollup merge of #129086 - slanterns:is_none_or, r=dtolnay
Stabilize `is_none_or`

Closes: https://github.com/rust-lang/rust/issues/126383.

`@rustbot` label: +T-libs-api

r? libs-api
-rw-r--r--compiler/rustc_const_eval/src/lib.rs1
-rw-r--r--compiler/rustc_hir_typeck/src/lib.rs1
-rw-r--r--library/core/src/option.rs4
-rw-r--r--src/tools/miri/src/lib.rs1
-rw-r--r--src/tools/rust-analyzer/crates/hir-ty/src/display.rs2
5 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs
index 780404212c3..d825a47bfdf 100644
--- a/compiler/rustc_const_eval/src/lib.rs
+++ b/compiler/rustc_const_eval/src/lib.rs
@@ -6,7 +6,6 @@
 #![feature(box_patterns)]
 #![feature(decl_macro)]
 #![feature(if_let_guard)]
-#![feature(is_none_or)]
 #![feature(let_chains)]
 #![feature(never_type)]
 #![feature(rustdoc_internals)]
diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs
index 758a1cefe63..9ec101196a4 100644
--- a/compiler/rustc_hir_typeck/src/lib.rs
+++ b/compiler/rustc_hir_typeck/src/lib.rs
@@ -5,7 +5,6 @@
 #![feature(box_patterns)]
 #![feature(control_flow_enum)]
 #![feature(if_let_guard)]
-#![feature(is_none_or)]
 #![feature(let_chains)]
 #![feature(never_type)]
 #![feature(try_blocks)]
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 9cec79c17ca..50cb22b7eb3 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -656,8 +656,6 @@ impl<T> Option<T> {
     /// # Examples
     ///
     /// ```
-    /// #![feature(is_none_or)]
-    ///
     /// let x: Option<u32> = Some(2);
     /// assert_eq!(x.is_none_or(|x| x > 1), true);
     ///
@@ -669,7 +667,7 @@ impl<T> Option<T> {
     /// ```
     #[must_use]
     #[inline]
-    #[unstable(feature = "is_none_or", issue = "126383")]
+    #[stable(feature = "is_none_or", since = "CURRENT_RUSTC_VERSION")]
     pub fn is_none_or(self, f: impl FnOnce(T) -> bool) -> bool {
         match self {
             None => true,
diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs
index 966d38508f6..7a11e353f9d 100644
--- a/src/tools/miri/src/lib.rs
+++ b/src/tools/miri/src/lib.rs
@@ -12,7 +12,6 @@
 #![feature(let_chains)]
 #![feature(trait_upcasting)]
 #![feature(strict_overflow_ops)]
-#![feature(is_none_or)]
 // Configure clippy and other lints
 #![allow(
     clippy::collapsible_else_if,
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/display.rs b/src/tools/rust-analyzer/crates/hir-ty/src/display.rs
index 7c481958d1a..f406666ae5a 100644
--- a/src/tools/rust-analyzer/crates/hir-ty/src/display.rs
+++ b/src/tools/rust-analyzer/crates/hir-ty/src/display.rs
@@ -1462,7 +1462,7 @@ fn generic_args_sans_defaults<'ga>(
                     // otherwise, if the arg is equal to the param default, hide it (unless the
                     // default is an error which can happen for the trait Self type)
                     #[allow(unstable_name_collisions)]
-                    default_parameters.get(i).is_none_or(|default_parameter| {
+                    IsNoneOr::is_none_or(default_parameters.get(i), |default_parameter| {
                         // !is_err(default_parameter.skip_binders())
                         //     &&
                         arg != &default_parameter.clone().substitute(Interner, &parameters)