Skip to content

Commit fd5aa07

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

9 files changed

Lines changed: 7 additions & 22 deletions

File tree

‎compiler/rustc_borrowck/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![doc(rust_logo)]
66
#![feature(assert_matches)]
77
#![feature(box_patterns)]
8-
#![feature(control_flow_enum)]
98
#![feature(file_buffered)]
109
#![feature(let_chains)]
1110
#![feature(never_type)]

‎compiler/rustc_hir_analysis/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ This API is completely unstable and subject to change.
6363
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
6464
#![doc(rust_logo)]
6565
#![feature(assert_matches)]
66-
#![feature(control_flow_enum)]
6766
#![feature(if_let_guard)]
6867
#![feature(iter_intersperse)]
6968
#![feature(let_chains)]

‎compiler/rustc_hir_typeck/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![allow(rustc::untranslatable_diagnostic)]
44
#![feature(array_windows)]
55
#![feature(box_patterns)]
6-
#![feature(control_flow_enum)]
76
#![feature(if_let_guard)]
87
#![feature(let_chains)]
98
#![feature(never_type)]

‎compiler/rustc_infer/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#![doc(rust_logo)]
2121
#![feature(assert_matches)]
2222
#![feature(box_patterns)]
23-
#![feature(control_flow_enum)]
2423
#![feature(extend_one)]
2524
#![feature(if_let_guard)]
2625
#![feature(iter_intersperse)]

‎compiler/rustc_lint/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(array_windows)]
3333
#![feature(assert_matches)]
3434
#![feature(box_patterns)]
35-
#![feature(control_flow_enum)]
3635
#![feature(extract_if)]
3736
#![feature(if_let_guard)]
3837
#![feature(iter_order_by)]

‎compiler/rustc_metadata/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![allow(rustc::potential_query_instability)]
44
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
55
#![doc(rust_logo)]
6-
#![feature(control_flow_enum)]
76
#![feature(coroutines)]
87
#![feature(decl_macro)]
98
#![feature(error_iter)]

‎compiler/rustc_trait_selection/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#![feature(associated_type_defaults)]
2121
#![feature(box_patterns)]
2222
#![feature(cfg_version)]
23-
#![feature(control_flow_enum)]
2423
#![feature(extract_if)]
2524
#![feature(if_let_guard)]
2625
#![feature(iter_intersperse)]

‎library/core/src/ops/control_flow.rs‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,13 @@ impl<B, C> ControlFlow<B, C> {
171171
/// # Examples
172172
///
173173
/// ```
174-
/// #![feature(control_flow_enum)]
175174
/// use std::ops::ControlFlow;
176175
///
177176
/// assert_eq!(ControlFlow::<i32, String>::Break(3).break_value(), Some(3));
178177
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).break_value(), None);
179178
/// ```
180179
#[inline]
181-
#[unstable(feature = "control_flow_enum",reason = "new API", issue = "75744")]
180+
#[stable(feature = "control_flow_enum",since = "CURRENT_RUSTC_VERSION")]
182181
pubfnbreak_value(self) -> Option<B>{
183182
matchself{
184183
ControlFlow::Continue(..) => None,
@@ -189,11 +188,8 @@ impl<B, C> ControlFlow<B, C> {
189188
/// Maps `ControlFlow<B, C>` to `ControlFlow<T, C>` by applying a function
190189
/// to the break value in case it exists.
191190
#[inline]
192-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
193-
pubfnmap_break<T,F>(self,f:F) -> ControlFlow<T,C>
194-
where
195-
F:FnOnce(B) -> T,
196-
{
191+
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
192+
pubfnmap_break<T>(self,f:implFnOnce(B) -> T) -> ControlFlow<T,C>{
197193
matchself{
198194
ControlFlow::Continue(x) => ControlFlow::Continue(x),
199195
ControlFlow::Break(x) => ControlFlow::Break(f(x)),
@@ -206,14 +202,13 @@ impl<B, C> ControlFlow<B, C> {
206202
/// # Examples
207203
///
208204
/// ```
209-
/// #![feature(control_flow_enum)]
210205
/// use std::ops::ControlFlow;
211206
///
212207
/// assert_eq!(ControlFlow::<i32, String>::Break(3).continue_value(), None);
213208
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).continue_value(), Some(3));
214209
/// ```
215210
#[inline]
216-
#[unstable(feature = "control_flow_enum",reason = "new API", issue = "75744")]
211+
#[stable(feature = "control_flow_enum",since = "CURRENT_RUSTC_VERSION")]
217212
pubfncontinue_value(self) -> Option<C>{
218213
matchself{
219214
ControlFlow::Continue(x) => Some(x),
@@ -224,11 +219,8 @@ impl<B, C> ControlFlow<B, C> {
224219
/// Maps `ControlFlow<B, C>` to `ControlFlow<B, T>` by applying a function
225220
/// to the continue value in case it exists.
226221
#[inline]
227-
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
228-
pubfnmap_continue<T,F>(self,f:F) -> ControlFlow<B,T>
229-
where
230-
F:FnOnce(C) -> T,
231-
{
222+
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
223+
pubfnmap_continue<T>(self,f:implFnOnce(C) -> T) -> ControlFlow<B,T>{
232224
matchself{
233225
ControlFlow::Continue(x) => ControlFlow::Continue(f(x)),
234226
ControlFlow::Break(x) => ControlFlow::Break(x),

‎library/core/src/ops/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub use self::async_function::{AsyncFn, AsyncFnMut, AsyncFnOnce};
162162
pubuseself::bit::{BitAnd,BitOr,BitXor,Not,Shl,Shr};
163163
#[stable(feature = "op_assign_traits", since = "1.8.0")]
164164
pubuseself::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
pubuseself::control_flow::ControlFlow;
167167
#[unstable(feature = "coroutine_trait", issue = "43122")]
168168
pubuseself::coroutine::{Coroutine,CoroutineState};

0 commit comments

Comments
 (0)