Skip to content

Commit 93c1f24

Browse files
committed
Stabilize the loop_break_value feature
1 parent 7b5c3d2 commit 93c1f24

File tree

12 files changed

+7
-115
lines changed

12 files changed

+7
-115
lines changed

src/doc/unstable-book/src/SUMMARY.md

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
- [link_llvm_intrinsics](language-features/link-llvm-intrinsics.md)
5050
- [linkage](language-features/linkage.md)
5151
- [log_syntax](language-features/log-syntax.md)
52-
- [loop_break_value](language-features/loop-break-value.md)
5352
- [macro_reexport](language-features/macro-reexport.md)
5453
- [macro_vis_matcher](language-features/macro-vis-matcher.md)
5554
- [main](language-features/main.md)

src/doc/unstable-book/src/language-features/loop-break-value.md

-83
This file was deleted.

src/librustc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#![feature(core_intrinsics)]
3131
#![feature(i128_type)]
3232
#![feature(libc)]
33-
#![feature(loop_break_value)]
3433
#![feature(never_type)]
3534
#![feature(nonzero)]
3635
#![feature(quote)]
@@ -45,6 +44,7 @@
4544
#![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
4645
#![cfg_attr(stage0, feature(rustc_private))]
4746
#![cfg_attr(stage0, feature(staged_api))]
47+
#![cfg_attr(stage0, feature(loop_break_value))]
4848

4949
#![recursion_limit="128"]
5050

src/librustc_driver/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![deny(warnings)]
2424

2525
#![feature(box_syntax)]
26-
#![feature(loop_break_value)]
2726
#![feature(libc)]
2827
#![feature(quote)]
2928
#![feature(rustc_diagnostic_macros)]
@@ -32,6 +31,7 @@
3231
#![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
3332
#![cfg_attr(stage0, feature(rustc_private))]
3433
#![cfg_attr(stage0, feature(staged_api))]
34+
#![cfg_attr(stage0, feature(loop_break_value))]
3535

3636
extern crate arena;
3737
extern crate getopts;

src/librustc_typeck/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ This API is completely unstable and subject to change.
7676
#![feature(box_patterns)]
7777
#![feature(box_syntax)]
7878
#![feature(conservative_impl_trait)]
79-
#![feature(loop_break_value)]
8079
#![feature(never_type)]
8180
#![feature(quote)]
8281
#![feature(rustc_diagnostic_macros)]
8382

8483
#![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
8584
#![cfg_attr(stage0, feature(rustc_private))]
8685
#![cfg_attr(stage0, feature(staged_api))]
86+
#![cfg_attr(stage0, feature(loop_break_value))]
8787

8888
#[macro_use] extern crate log;
8989
#[macro_use] extern crate syntax;

src/libsyntax/feature_gate.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,6 @@ declare_features! (
297297

298298
(active, use_extern_macros, "1.15.0", Some(35896)),
299299

300-
// Allows `break {expr}` with a value inside `loop`s.
301-
(active, loop_break_value, "1.14.0", Some(37339)),
302-
303300
// Allows #[target_feature(...)]
304301
(active, target_feature, "1.15.0", None),
305302

@@ -423,6 +420,8 @@ declare_features! (
423420
(accepted, pub_restricted, "1.18.0", Some(32409)),
424421
// The #![windows_subsystem] attribute
425422
(accepted, windows_subsystem, "1.18.0", Some(37499)),
423+
// Allows `break {expr}` with a value inside `loop`s.
424+
(accepted, loop_break_value, "1.19.0", Some(37339)),
426425
);
427426
// If you change this, please modify src/doc/unstable-book as well. You must
428427
// move that documentation into the relevant place in the other docs, and
@@ -1301,10 +1300,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
13011300
}
13021301
}
13031302
}
1304-
ast::ExprKind::Break(_, Some(_)) => {
1305-
gate_feature_post!(&self, loop_break_value, e.span,
1306-
"`break` with a value is experimental");
1307-
}
13081303
ast::ExprKind::Lit(ref lit) => {
13091304
if let ast::LitKind::Int(_, ref ty) = lit.node {
13101305
match *ty {

src/test/compile-fail/feature-gate-loop-break-value.rs

-15
This file was deleted.

src/test/compile-fail/loop-break-value.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(loop_break_value)]
1211
#![feature(never_type)]
1312

1413
fn main() {

src/test/run-pass/diverging-fallback-control-flow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// like to revisit these and potentially change them. --nmatsakis
1616

1717
#![feature(never_type)]
18-
#![feature(loop_break_value)]
1918

2019
trait BadDefault {
2120
fn default() -> Self;

src/test/run-pass/loop-break-value.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(loop_break_value)]
1211
#![feature(never_type)]
1312

1413
#[allow(unused)]

src/test/ui/loop-break-value-no-repeat.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(loop_break_value)]
1211
#![allow(unused_variables)]
1312

1413
use std::ptr;

src/test/ui/loop-break-value-no-repeat.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0571]: `break` with value from a `for` loop
2-
--> $DIR/loop-break-value-no-repeat.rs:23:9
2+
--> $DIR/loop-break-value-no-repeat.rs:22:9
33
|
4-
23 | break 22
4+
22 | break 22
55
| ^^^^^^^^ can only break with a value inside `loop`
66

77
error: aborting due to previous error

0 commit comments

Comments
 (0)