Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b9eaf6c

Browse files
authoredJun 7, 2024
Rollup merge of rust-lang#126089 - wutchzone:option_take_if, r=scottmcm
Stabilize Option::take_if Closes rust-lang#98934 ed: FCP complete in rust-lang#98934 (comment)
2 parents 60a590a + 26dc8bd commit b9eaf6c

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed
 

‎compiler/rustc_trait_selection/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(extract_if)]
2424
#![feature(if_let_guard)]
2525
#![feature(let_chains)]
26-
#![feature(option_take_if)]
2726
#![feature(never_type)]
2827
#![feature(type_alias_impl_trait)]
2928
#![recursion_limit = "512"] // For rustdoc

‎library/core/src/option.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1708,8 +1708,6 @@ impl<T> Option<T> {
17081708
/// # Examples
17091709
///
17101710
/// ```
1711-
/// #![feature(option_take_if)]
1712-
///
17131711
/// let mut x = Some(42);
17141712
///
17151713
/// let prev = x.take_if(|v| if *v == 42 {
@@ -1726,7 +1724,7 @@ impl<T> Option<T> {
17261724
/// assert_eq!(prev, Some(43));
17271725
/// ```
17281726
#[inline]
1729-
#[unstable(feature = "option_take_if", issue = "98934")]
1727+
#[stable(feature = "option_take_if", since = "CURRENT_RUSTC_VERSION")]
17301728
pub fn take_if<P>(&mut self, predicate: P) -> Option<T>
17311729
where
17321730
P: FnOnce(&mut T) -> bool,

0 commit comments

Comments
 (0)
Failed to load comments.