Skip to content

Commit 9d57e46

Browse files
authored
Rollup merge of #129086 - slanterns:is_none_or, r=dtolnay
Stabilize `is_none_or` Closes: #126383. `@rustbot` label: +T-libs-api r? libs-api
2 parents f04d25f + 14ac0a3 commit 9d57e46

File tree

5 files changed

+2
-7
lines changed

5 files changed

+2
-7
lines changed

Diff for: compiler/rustc_const_eval/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(box_patterns)]
77
#![feature(decl_macro)]
88
#![feature(if_let_guard)]
9-
#![feature(is_none_or)]
109
#![feature(let_chains)]
1110
#![feature(never_type)]
1211
#![feature(rustdoc_internals)]

Diff for: compiler/rustc_hir_typeck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(box_patterns)]
66
#![feature(control_flow_enum)]
77
#![feature(if_let_guard)]
8-
#![feature(is_none_or)]
98
#![feature(let_chains)]
109
#![feature(never_type)]
1110
#![feature(try_blocks)]

Diff for: library/core/src/option.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,6 @@ impl<T> Option<T> {
656656
/// # Examples
657657
///
658658
/// ```
659-
/// #![feature(is_none_or)]
660-
///
661659
/// let x: Option<u32> = Some(2);
662660
/// assert_eq!(x.is_none_or(|x| x > 1), true);
663661
///
@@ -669,7 +667,7 @@ impl<T> Option<T> {
669667
/// ```
670668
#[must_use]
671669
#[inline]
672-
#[unstable(feature = "is_none_or", issue = "126383")]
670+
#[stable(feature = "is_none_or", since = "CURRENT_RUSTC_VERSION")]
673671
pub fn is_none_or(self, f: impl FnOnce(T) -> bool) -> bool {
674672
match self {
675673
None => true,

Diff for: src/tools/miri/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![feature(let_chains)]
1313
#![feature(trait_upcasting)]
1414
#![feature(strict_overflow_ops)]
15-
#![feature(is_none_or)]
1615
// Configure clippy and other lints
1716
#![allow(
1817
clippy::collapsible_else_if,

Diff for: src/tools/rust-analyzer/crates/hir-ty/src/display.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ fn generic_args_sans_defaults<'ga>(
14621462
// otherwise, if the arg is equal to the param default, hide it (unless the
14631463
// default is an error which can happen for the trait Self type)
14641464
#[allow(unstable_name_collisions)]
1465-
default_parameters.get(i).is_none_or(|default_parameter| {
1465+
IsNoneOr::is_none_or(default_parameters.get(i), |default_parameter| {
14661466
// !is_err(default_parameter.skip_binders())
14671467
// &&
14681468
arg != &default_parameter.clone().substitute(Interner, &parameters)

0 commit comments

Comments
 (0)