Skip to content

Commit dd1caed

Browse files
committed
Stabilize the map/value methods on ControlFlow
And fix the stability attribute on the `pub use` in `core::ops`.
1 parent f7b4c72 commit dd1caed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/core/src/ops/control_flow.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<B, C> ControlFlow<B, C> {
178178
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).break_value(), None);
179179
/// ```
180180
#[inline]
181-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
181+
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
182182
pub fn break_value(self) -> Option<B> {
183183
match self {
184184
ControlFlow::Continue(..) => None,
@@ -189,7 +189,7 @@ impl<B, C> ControlFlow<B, C> {
189189
/// Maps `ControlFlow<B, C>` to `ControlFlow<T, C>` by applying a function
190190
/// to the break value in case it exists.
191191
#[inline]
192-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
192+
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
193193
pub fn map_break<T, F>(self, f: F) -> ControlFlow<T, C>
194194
where
195195
F: FnOnce(B) -> T,
@@ -213,7 +213,7 @@ impl<B, C> ControlFlow<B, C> {
213213
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).continue_value(), Some(3));
214214
/// ```
215215
#[inline]
216-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
216+
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
217217
pub fn continue_value(self) -> Option<C> {
218218
match self {
219219
ControlFlow::Continue(x) => Some(x),
@@ -224,7 +224,7 @@ impl<B, C> ControlFlow<B, C> {
224224
/// Maps `ControlFlow<B, C>` to `ControlFlow<B, T>` by applying a function
225225
/// to the continue value in case it exists.
226226
#[inline]
227-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
227+
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
228228
pub fn map_continue<T, F>(self, f: F) -> ControlFlow<B, T>
229229
where
230230
F: FnOnce(C) -> T,

library/core/src/ops/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub use self::async_function::{AsyncFn, AsyncFnMut, AsyncFnOnce};
162162
pub use self::bit::{BitAnd, BitOr, BitXor, Not, Shl, Shr};
163163
#[stable(feature = "op_assign_traits", since = "1.8.0")]
164164
pub use self::bit::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign};
165-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
165+
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]
166166
pub use self::control_flow::ControlFlow;
167167
#[unstable(feature = "coroutine_trait", issue = "43122")]
168168
pub use self::coroutine::{Coroutine, CoroutineState};

0 commit comments

Comments
 (0)