Skip to content

Commit f4550a6

Browse files
authored
Rollup merge of #99332 - jyn514:stabilize-label-break-value, r=petrochenkov
Stabilize `#![feature(label_break_value)]` See the stabilization report in #48594 (comment).
2 parents addacb5 + 31e3944 commit f4550a6

39 files changed

+61
-108
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![feature(const_default_impls)]
1414
#![feature(const_trait_impl)]
1515
#![feature(if_let_guard)]
16-
#![feature(label_break_value)]
16+
#![cfg_attr(bootstrap, feature(label_break_value))]
1717
#![feature(min_specialization)]
1818
#![feature(negative_impls)]
1919
#![feature(slice_internals)]

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
647647
ast::ExprKind::TryBlock(_) => {
648648
gate_feature_post!(&self, try_blocks, e.span, "`try` expression is experimental");
649649
}
650-
ast::ExprKind::Block(_, Some(label)) => {
651-
gate_feature_post!(
652-
&self,
653-
label_break_value,
654-
label.ident.span,
655-
"labels on blocks are unstable"
656-
);
657-
}
658650
_ => {}
659651
}
660652
visit::walk_expr(self, e)
@@ -823,7 +815,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
823815
gate_all!(box_patterns, "box pattern syntax is experimental");
824816
gate_all!(exclusive_range_pattern, "exclusive range pattern syntax is experimental");
825817
gate_all!(try_blocks, "`try` blocks are unstable");
826-
gate_all!(label_break_value, "labels on blocks are unstable");
827818
gate_all!(box_syntax, "box expression syntax is experimental; you can call `Box::new` instead");
828819
gate_all!(type_ascription, "type ascription is experimental");
829820

compiler/rustc_error_codes/src/error_codes/E0695.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ A `break` statement without a label appeared inside a labeled block.
33
Erroneous code example:
44

55
```compile_fail,E0695
6-
# #![feature(label_break_value)]
76
loop {
87
'a: {
98
break;
@@ -14,7 +13,6 @@ loop {
1413
Make sure to always label the `break`:
1514

1615
```
17-
# #![feature(label_break_value)]
1816
'l: loop {
1917
'a: {
2018
break 'l;
@@ -25,7 +23,6 @@ Make sure to always label the `break`:
2523
Or if you want to `break` the labeled block:
2624

2725
```
28-
# #![feature(label_break_value)]
2926
loop {
3027
'a: {
3128
break 'a;

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ declare_features! (
186186
/// Allows some increased flexibility in the name resolution rules,
187187
/// especially around globs and shadowing (RFC 1560).
188188
(accepted, item_like_imports, "1.15.0", Some(35120), None),
189+
/// Allows `'a: { break 'a; }`.
190+
(accepted, label_break_value, "1.65.0", Some(48594), None),
189191
/// Allows `if/while p && let q = r && ...` chains.
190192
(accepted, let_chains, "1.64.0", Some(53667), None),
191193
/// Allows `break {expr}` with a value inside `loop`s.

compiler/rustc_feature/src/active.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,6 @@ declare_features! (
420420
(active, intra_doc_pointers, "1.51.0", Some(80896), None),
421421
/// Allows `#[instruction_set(_)]` attribute
422422
(active, isa_attribute, "1.48.0", Some(74727), None),
423-
/// Allows `'a: { break 'a; }`.
424-
(active, label_break_value, "1.28.0", Some(48594), None),
425423
// Allows setting the threshold for the `large_assignments` lint.
426424
(active, large_assignments, "1.52.0", Some(83518), None),
427425
/// Allows `let...else` statements.

compiler/rustc_infer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#![feature(box_patterns)]
1818
#![feature(control_flow_enum)]
1919
#![feature(extend_one)]
20-
#![feature(label_break_value)]
20+
#![cfg_attr(bootstrap, feature(label_break_value))]
2121
#![feature(let_else)]
2222
#![feature(min_specialization)]
2323
#![feature(never_type)]

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,10 +2014,6 @@ impl<'a> Parser<'a> {
20142014
}
20152015
}
20162016

2017-
if let Some(label) = opt_label {
2018-
self.sess.gated_spans.gate(sym::label_break_value, label.ident.span);
2019-
}
2020-
20212017
if self.token.is_whole_block() {
20222018
self.sess.emit_err(InvalidBlockMacroSegment {
20232019
span: self.token.span,

compiler/rustc_trait_selection/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#![feature(control_flow_enum)]
1717
#![feature(drain_filter)]
1818
#![feature(hash_drain_filter)]
19-
#![feature(label_break_value)]
19+
#![cfg_attr(bootstrap, feature(label_break_value))]
2020
#![feature(let_else)]
2121
#![feature(if_let_guard)]
2222
#![feature(never_type)]

compiler/rustc_typeck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This API is completely unstable and subject to change.
6464
#![feature(if_let_guard)]
6565
#![feature(is_sorted)]
6666
#![feature(iter_intersperse)]
67-
#![feature(label_break_value)]
67+
#![cfg_attr(bootstrap, feature(label_break_value))]
6868
#![feature(let_else)]
6969
#![feature(min_specialization)]
7070
#![feature(never_type)]

library/std/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
#![feature(dropck_eyepatch)]
253253
#![feature(exhaustive_patterns)]
254254
#![feature(intra_doc_pointers)]
255-
#![feature(label_break_value)]
255+
#![cfg_attr(bootstrap, feature(label_break_value))]
256256
#![feature(lang_items)]
257257
#![feature(let_else)]
258258
#![feature(linkage)]

0 commit comments

Comments
 (0)