Skip to content

Commit 4ed2694

Browse files
authored
Rollup merge of #79299 - varkor:stabilise-then, r=m-ou-se
Stabilise `then` Stabilises the lazy variant of #64260 now that the FCP [has ended](#64260 (comment)). I've kept the original feature gate `bool_to_option` for the strict variant (`then_some`), and created a new insta-stable feature gate `lazy_bool_to_option` for `then`.
2 parents b987c3a + cf32afc commit 4ed2694

File tree

6 files changed

+1
-8
lines changed

6 files changed

+1
-8
lines changed

compiler/rustc_index/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(allow_internal_unstable)]
2-
#![feature(bool_to_option)]
32
#![feature(const_fn)]
43
#![feature(const_panic)]
54
#![feature(extend_one)]

compiler/rustc_metadata/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2-
#![feature(bool_to_option)]
32
#![feature(core_intrinsics)]
43
#![feature(crate_visibility_modifier)]
54
#![feature(drain_filter)]

compiler/rustc_parse/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! The main parser interface.
22
3-
#![feature(bool_to_option)]
43
#![feature(crate_visibility_modifier)]
54
#![feature(bindings_after_at)]
65
#![feature(iter_order_by)]

library/core/src/bool.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ impl bool {
2323
/// # Examples
2424
///
2525
/// ```
26-
/// #![feature(bool_to_option)]
27-
///
2826
/// assert_eq!(false.then(|| 0), None);
2927
/// assert_eq!(true.then(|| 0), Some(0));
3028
/// ```
31-
#[unstable(feature = "bool_to_option", issue = "64260")]
29+
#[stable(feature = "lazy_bool_to_option", since = "1.50.0")]
3230
#[inline]
3331
pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
3432
if self { Some(f()) } else { None }

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@
227227
#![feature(asm)]
228228
#![feature(associated_type_bounds)]
229229
#![feature(atomic_mut_ptr)]
230-
#![feature(bool_to_option)]
231230
#![feature(box_syntax)]
232231
#![feature(c_variadic)]
233232
#![feature(cfg_accessible)]

library/test/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
2424
#![feature(rustc_private)]
2525
#![feature(nll)]
26-
#![feature(bool_to_option)]
2726
#![feature(available_concurrency)]
2827
#![feature(internal_output_capture)]
2928
#![feature(panic_unwind)]

0 commit comments

Comments
 (0)