mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Stabilise then
This commit is contained in:
parent
20328b5323
commit
cf32afcf48
@ -1,5 +1,4 @@
|
|||||||
#![feature(allow_internal_unstable)]
|
#![feature(allow_internal_unstable)]
|
||||||
#![feature(bool_to_option)]
|
|
||||||
#![feature(const_fn)]
|
#![feature(const_fn)]
|
||||||
#![feature(const_panic)]
|
#![feature(const_panic)]
|
||||||
#![feature(extend_one)]
|
#![feature(extend_one)]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![feature(bool_to_option)]
|
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(crate_visibility_modifier)]
|
#![feature(crate_visibility_modifier)]
|
||||||
#![feature(drain_filter)]
|
#![feature(drain_filter)]
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
//! The main parser interface.
|
//! The main parser interface.
|
||||||
|
|
||||||
#![feature(bool_to_option)]
|
|
||||||
#![feature(crate_visibility_modifier)]
|
#![feature(crate_visibility_modifier)]
|
||||||
#![feature(bindings_after_at)]
|
#![feature(bindings_after_at)]
|
||||||
#![feature(iter_order_by)]
|
#![feature(iter_order_by)]
|
||||||
|
@ -23,12 +23,10 @@ impl bool {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(bool_to_option)]
|
|
||||||
///
|
|
||||||
/// assert_eq!(false.then(|| 0), None);
|
/// assert_eq!(false.then(|| 0), None);
|
||||||
/// assert_eq!(true.then(|| 0), Some(0));
|
/// assert_eq!(true.then(|| 0), Some(0));
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "bool_to_option", issue = "64260")]
|
#[stable(feature = "lazy_bool_to_option", since = "1.50.0")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
|
pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
|
||||||
if self { Some(f()) } else { None }
|
if self { Some(f()) } else { None }
|
||||||
|
@ -227,7 +227,6 @@
|
|||||||
#![feature(asm)]
|
#![feature(asm)]
|
||||||
#![feature(associated_type_bounds)]
|
#![feature(associated_type_bounds)]
|
||||||
#![feature(atomic_mut_ptr)]
|
#![feature(atomic_mut_ptr)]
|
||||||
#![feature(bool_to_option)]
|
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
#![feature(c_variadic)]
|
#![feature(c_variadic)]
|
||||||
#![feature(cfg_accessible)]
|
#![feature(cfg_accessible)]
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
|
#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
#![feature(nll)]
|
#![feature(nll)]
|
||||||
#![feature(bool_to_option)]
|
|
||||||
#![feature(available_concurrency)]
|
#![feature(available_concurrency)]
|
||||||
#![feature(internal_output_capture)]
|
#![feature(internal_output_capture)]
|
||||||
#![feature(panic_unwind)]
|
#![feature(panic_unwind)]
|
||||||
|
Loading…
Reference in New Issue
Block a user