Skip to content

Commit f4810cb

Browse files
Rollup merge of rust-lang#152911 - nxsaken:stable_control_flow_ok, r=dtolnay
Stabilize `control_flow_ok` Feature: `control_flow_ok` Tracking issue: rust-lang#140266 r? @dtolnay
2 parents 6a44bbd + c5da0e3 commit f4810cb

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

library/core/src/ops/control_flow.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ impl<B, C> ControlFlow<B, C> {
203203
/// # Examples
204204
///
205205
/// ```
206-
/// #![feature(control_flow_ok)]
207-
///
208206
/// use std::ops::ControlFlow;
209207
///
210208
/// struct TreeNode<T> {
@@ -263,8 +261,9 @@ impl<B, C> ControlFlow<B, C> {
263261
/// assert_eq!(res, Ok(&5));
264262
/// ```
265263
#[inline]
266-
#[unstable(feature = "control_flow_ok", issue = "140266")]
267-
#[rustc_const_unstable(feature = "control_flow_ok", issue = "140266")]
264+
#[stable(feature = "control_flow_ok", since = "CURRENT_RUSTC_VERSION")]
265+
#[rustc_const_stable(feature = "control_flow_ok", since = "CURRENT_RUSTC_VERSION")]
266+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
268267
pub const fn break_ok(self) -> Result<B, C> {
269268
match self {
270269
ControlFlow::Continue(c) => Err(c),
@@ -317,8 +316,6 @@ impl<B, C> ControlFlow<B, C> {
317316
/// # Examples
318317
///
319318
/// ```
320-
/// #![feature(control_flow_ok)]
321-
///
322319
/// use std::ops::ControlFlow;
323320
///
324321
/// struct TreeNode<T> {
@@ -376,8 +373,9 @@ impl<B, C> ControlFlow<B, C> {
376373
/// assert_eq!(res, Err("too big value detected"));
377374
/// ```
378375
#[inline]
379-
#[unstable(feature = "control_flow_ok", issue = "140266")]
380-
#[rustc_const_unstable(feature = "control_flow_ok", issue = "140266")]
376+
#[stable(feature = "control_flow_ok", since = "CURRENT_RUSTC_VERSION")]
377+
#[rustc_const_stable(feature = "control_flow_ok", since = "CURRENT_RUSTC_VERSION")]
378+
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
381379
pub const fn continue_ok(self) -> Result<C, B> {
382380
match self {
383381
ControlFlow::Continue(c) => Ok(c),

library/coretests/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(const_select_unpredictable)]
3333
#![feature(const_trait_impl)]
3434
#![feature(const_unsigned_bigint_helpers)]
35-
#![feature(control_flow_ok)]
3635
#![feature(core_intrinsics)]
3736
#![feature(core_intrinsics_fallbacks)]
3837
#![feature(core_io_borrowed_buf)]

0 commit comments

Comments
 (0)