Skip to content

Commit c854ac8

Browse files
committed
Auto merge of #156594 - LimpSquid:stabilize-bool-to-result, r=SimonSapin
Stabilize bool_to_result Closes #142748
2 parents 5043948 + afc399f commit c854ac8

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

library/core/src/bool.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,11 @@ impl bool {
7878
/// # Examples
7979
///
8080
/// ```
81-
/// #![feature(bool_to_result)]
82-
///
8381
/// assert_eq!(false.ok_or(0), Err(0));
8482
/// assert_eq!(true.ok_or(0), Ok(()));
8583
/// ```
8684
///
8785
/// ```
88-
/// #![feature(bool_to_result)]
89-
///
9086
/// let mut a = 0;
9187
/// let mut function_with_side_effects = || { a += 1; };
9288
///
@@ -97,7 +93,7 @@ impl bool {
9793
/// // evaluated eagerly.
9894
/// assert_eq!(a, 2);
9995
/// ```
100-
#[unstable(feature = "bool_to_result", issue = "142748")]
96+
#[stable(feature = "bool_to_result", since = "CURRENT_RUSTC_VERSION")]
10197
#[rustc_const_unstable(feature = "const_bool", issue = "151531")]
10298
#[inline]
10399
pub const fn ok_or<E: [const] Destruct>(self, err: E) -> Result<(), E> {
@@ -110,15 +106,11 @@ impl bool {
110106
/// # Examples
111107
///
112108
/// ```
113-
/// #![feature(bool_to_result)]
114-
///
115109
/// assert_eq!(false.ok_or_else(|| 0), Err(0));
116110
/// assert_eq!(true.ok_or_else(|| 0), Ok(()));
117111
/// ```
118112
///
119113
/// ```
120-
/// #![feature(bool_to_result)]
121-
///
122114
/// let mut a = 0;
123115
///
124116
/// assert!(true.ok_or_else(|| { a += 1; }).is_ok());
@@ -128,7 +120,7 @@ impl bool {
128120
/// // `ok_or_else`.
129121
/// assert_eq!(a, 1);
130122
/// ```
131-
#[unstable(feature = "bool_to_result", issue = "142748")]
123+
#[stable(feature = "bool_to_result", since = "CURRENT_RUSTC_VERSION")]
132124
#[rustc_const_unstable(feature = "const_bool", issue = "151531")]
133125
#[inline]
134126
pub const fn ok_or_else<E, F: [const] FnOnce() -> E + [const] Destruct>(

library/coretests/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(ascii_char_variants)]
99
#![feature(async_iter_from_iter)]
1010
#![feature(async_iterator)]
11-
#![feature(bool_to_result)]
1211
#![feature(borrowed_buf_init)]
1312
#![feature(bstr)]
1413
#![feature(cfg_target_has_reliable_f16_f128)]

0 commit comments

Comments
 (0)