Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions library/core/src/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,11 @@ impl bool {
/// # Examples
///
/// ```
/// #![feature(bool_to_result)]
///
/// assert_eq!(false.ok_or(0), Err(0));
/// assert_eq!(true.ok_or(0), Ok(()));
/// ```
///
/// ```
/// #![feature(bool_to_result)]
///
/// let mut a = 0;
/// let mut function_with_side_effects = || { a += 1; };
///
Expand All @@ -97,7 +93,7 @@ impl bool {
/// // evaluated eagerly.
/// assert_eq!(a, 2);
/// ```
#[unstable(feature = "bool_to_result", issue = "142748")]
#[stable(feature = "bool_to_result", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_unstable(feature = "const_bool", issue = "151531")]
#[inline]
pub const fn ok_or<E: [const] Destruct>(self, err: E) -> Result<(), E> {
Expand All @@ -110,15 +106,11 @@ impl bool {
/// # Examples
///
/// ```
/// #![feature(bool_to_result)]
///
/// assert_eq!(false.ok_or_else(|| 0), Err(0));
/// assert_eq!(true.ok_or_else(|| 0), Ok(()));
/// ```
///
/// ```
/// #![feature(bool_to_result)]
///
/// let mut a = 0;
///
/// assert!(true.ok_or_else(|| { a += 1; }).is_ok());
Expand All @@ -128,7 +120,7 @@ impl bool {
/// // `ok_or_else`.
/// assert_eq!(a, 1);
/// ```
#[unstable(feature = "bool_to_result", issue = "142748")]
#[stable(feature = "bool_to_result", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_unstable(feature = "const_bool", issue = "151531")]
#[inline]
pub const fn ok_or_else<E, F: [const] FnOnce() -> E + [const] Destruct>(
Expand Down
1 change: 0 additions & 1 deletion library/coretests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#![feature(ascii_char_variants)]
#![feature(async_iter_from_iter)]
#![feature(async_iterator)]
#![feature(bool_to_result)]
#![feature(borrowed_buf_init)]
#![feature(bstr)]
#![feature(cfg_target_has_reliable_f16_f128)]
Expand Down
Loading