diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 2426a0cb7dd10..f9b4d76f28f8a 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -13,7 +13,7 @@ #![feature(const_default_impls)] #![feature(const_trait_impl)] #![feature(if_let_guard)] -#![feature(label_break_value)] +#![cfg_attr(bootstrap, feature(label_break_value))] #![feature(min_specialization)] #![feature(negative_impls)] #![feature(slice_internals)] diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 68fca08101891..4ac96ec8b609c 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -647,14 +647,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { ast::ExprKind::TryBlock(_) => { gate_feature_post!(&self, try_blocks, e.span, "`try` expression is experimental"); } - ast::ExprKind::Block(_, Some(label)) => { - gate_feature_post!( - &self, - label_break_value, - label.ident.span, - "labels on blocks are unstable" - ); - } _ => {} } visit::walk_expr(self, e) @@ -823,7 +815,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) { gate_all!(box_patterns, "box pattern syntax is experimental"); gate_all!(exclusive_range_pattern, "exclusive range pattern syntax is experimental"); gate_all!(try_blocks, "`try` blocks are unstable"); - gate_all!(label_break_value, "labels on blocks are unstable"); gate_all!(box_syntax, "box expression syntax is experimental; you can call `Box::new` instead"); gate_all!(type_ascription, "type ascription is experimental"); diff --git a/compiler/rustc_error_codes/src/error_codes/E0695.md b/compiler/rustc_error_codes/src/error_codes/E0695.md index 5013e83ca0362..577f42ef3017c 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0695.md +++ b/compiler/rustc_error_codes/src/error_codes/E0695.md @@ -3,7 +3,6 @@ A `break` statement without a label appeared inside a labeled block. Erroneous code example: ```compile_fail,E0695 -# #![feature(label_break_value)] loop { 'a: { break; @@ -14,7 +13,6 @@ loop { Make sure to always label the `break`: ``` -# #![feature(label_break_value)] 'l: loop { 'a: { break 'l; @@ -25,7 +23,6 @@ Make sure to always label the `break`: Or if you want to `break` the labeled block: ``` -# #![feature(label_break_value)] loop { 'a: { break 'a; diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 2d24101b2d59a..37b2b0ecad772 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -186,6 +186,8 @@ declare_features! ( /// Allows some increased flexibility in the name resolution rules, /// especially around globs and shadowing (RFC 1560). (accepted, item_like_imports, "1.15.0", Some(35120), None), + /// Allows `'a: { break 'a; }`. + (accepted, label_break_value, "1.65.0", Some(48594), None), /// Allows `if/while p && let q = r && ...` chains. (accepted, let_chains, "1.64.0", Some(53667), None), /// Allows `break {expr}` with a value inside `loop`s. diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 1018facebaed9..22178dd2123e5 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -420,8 +420,6 @@ declare_features! ( (active, intra_doc_pointers, "1.51.0", Some(80896), None), /// Allows `#[instruction_set(_)]` attribute (active, isa_attribute, "1.48.0", Some(74727), None), - /// Allows `'a: { break 'a; }`. - (active, label_break_value, "1.28.0", Some(48594), None), // Allows setting the threshold for the `large_assignments` lint. (active, large_assignments, "1.52.0", Some(83518), None), /// Allows `let...else` statements. diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 1c515f5ee5722..8f02a6cc4a14d 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -17,7 +17,7 @@ #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(extend_one)] -#![feature(label_break_value)] +#![cfg_attr(bootstrap, feature(label_break_value))] #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index df092f55bfae9..94923d8ca76d4 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2075,10 +2075,6 @@ impl<'a> Parser<'a> { } } - if let Some(label) = opt_label { - self.sess.gated_spans.gate(sym::label_break_value, label.ident.span); - } - if self.token.is_whole_block() { self.struct_span_err(self.token.span, "cannot use a `block` macro fragment here") .span_label(lo.to(self.token.span), "the `block` fragment is within this context") diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 9c252fcfe1c63..059feb9564318 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -16,7 +16,7 @@ #![feature(control_flow_enum)] #![feature(drain_filter)] #![feature(hash_drain_filter)] -#![feature(label_break_value)] +#![cfg_attr(bootstrap, feature(label_break_value))] #![feature(let_else)] #![feature(if_let_guard)] #![feature(never_type)] diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index 8c6fb6a77181d..ffcd74858d383 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -64,7 +64,7 @@ This API is completely unstable and subject to change. #![feature(if_let_guard)] #![feature(is_sorted)] #![feature(iter_intersperse)] -#![feature(label_break_value)] +#![cfg_attr(bootstrap, feature(label_break_value))] #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 5029023121fc2..5047a58369eb0 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -252,7 +252,7 @@ #![feature(dropck_eyepatch)] #![feature(exhaustive_patterns)] #![feature(intra_doc_pointers)] -#![feature(label_break_value)] +#![cfg_attr(bootstrap, feature(label_break_value))] #![feature(lang_items)] #![feature(let_else)] #![feature(linkage)] diff --git a/src/test/ui/feature-gates/feature-gate-label_break_value.rs b/src/test/ui/feature-gates/feature-gate-label_break_value.rs deleted file mode 100644 index 6fc38f45517ef..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-label_break_value.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub fn main() { - 'a: { //~ ERROR labels on blocks are unstable - break 'a; - } -} diff --git a/src/test/ui/feature-gates/feature-gate-label_break_value.stderr b/src/test/ui/feature-gates/feature-gate-label_break_value.stderr deleted file mode 100644 index 4b43fdc593fa3..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-label_break_value.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: labels on blocks are unstable - --> $DIR/feature-gate-label_break_value.rs:2:5 - | -LL | 'a: { - | ^^ - | - = note: see issue #48594 for more information - = help: add `#![feature(label_break_value)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/for-loop-while/label_break_value.rs b/src/test/ui/for-loop-while/label_break_value.rs index ca9d71a7a8b66..10992c50597b6 100644 --- a/src/test/ui/for-loop-while/label_break_value.rs +++ b/src/test/ui/for-loop-while/label_break_value.rs @@ -1,7 +1,6 @@ // run-pass #![allow(dead_code)] #![allow(unused_assignments)] -#![feature(label_break_value)] // Test control flow to follow label_break_value semantics fn label_break(a: bool, b: bool) -> u32 { diff --git a/src/test/ui/for-loop-while/label_break_value_invalid.rs b/src/test/ui/for-loop-while/label_break_value_invalid.rs index 149bf17b83cba..fcf2e0f294e5c 100644 --- a/src/test/ui/for-loop-while/label_break_value_invalid.rs +++ b/src/test/ui/for-loop-while/label_break_value_invalid.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(label_break_value)] fn lbv_macro_test_hygiene_respected() { macro_rules! mac2 { diff --git a/src/test/ui/for-loop-while/label_break_value_invalid.stderr b/src/test/ui/for-loop-while/label_break_value_invalid.stderr index 7182b8f598f19..f6999c4ab116a 100644 --- a/src/test/ui/for-loop-while/label_break_value_invalid.stderr +++ b/src/test/ui/for-loop-while/label_break_value_invalid.stderr @@ -1,5 +1,5 @@ error[E0426]: use of undeclared label `'a` - --> $DIR/label_break_value_invalid.rs:7:19 + --> $DIR/label_break_value_invalid.rs:6:19 | LL | break 'a $val; | ^^ undeclared label `'a` @@ -10,7 +10,7 @@ LL | mac2!(2); = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0426]: use of undeclared label `'a` - --> $DIR/label_break_value_invalid.rs:29:19 + --> $DIR/label_break_value_invalid.rs:28:19 | LL | let x: u8 = mac3!('b: { | -- a label with a similar name is reachable @@ -22,7 +22,7 @@ LL | break 'a 3; | help: try using similarly named label: `'b` error[E0426]: use of undeclared label `'a` - --> $DIR/label_break_value_invalid.rs:34:29 + --> $DIR/label_break_value_invalid.rs:33:29 | LL | let x: u8 = mac3!(break 'a 4); | ^^ undeclared label `'a` diff --git a/src/test/ui/issues/issue-62480.rs b/src/test/ui/issues/issue-62480.rs index 5c3be3e64ee1a..94a9c2ab8be8e 100644 --- a/src/test/ui/issues/issue-62480.rs +++ b/src/test/ui/issues/issue-62480.rs @@ -1,5 +1,3 @@ -#![feature(label_break_value)] - fn main() { // This used to ICE during liveness check because `target_id` passed to // `propagate_through_expr` would be the closure and not the `loop`, which wouldn't be found in diff --git a/src/test/ui/issues/issue-62480.stderr b/src/test/ui/issues/issue-62480.stderr index 17085ef908bdf..db230537037a4 100644 --- a/src/test/ui/issues/issue-62480.stderr +++ b/src/test/ui/issues/issue-62480.stderr @@ -1,5 +1,5 @@ error[E0767]: use of unreachable label `'a` - --> $DIR/issue-62480.rs:8:18 + --> $DIR/issue-62480.rs:6:18 | LL | 'a: { | -- unreachable label defined here @@ -9,7 +9,7 @@ LL | || break 'a = note: labels are unreachable through functions, closures, async blocks and modules error[E0267]: `break` inside of a closure - --> $DIR/issue-62480.rs:8:12 + --> $DIR/issue-62480.rs:6:12 | LL | || break 'a | -- ^^^^^^^^ cannot `break` inside of a closure diff --git a/src/test/ui/label/label_break_value_continue.rs b/src/test/ui/label/label_break_value_continue.rs index e0deb30c9503b..22172f4fd2e88 100644 --- a/src/test/ui/label/label_break_value_continue.rs +++ b/src/test/ui/label/label_break_value_continue.rs @@ -1,4 +1,3 @@ -#![feature(label_break_value)] #![allow(unused_labels)] // Simple continue pointing to an unlabeled break should yield in an error diff --git a/src/test/ui/label/label_break_value_continue.stderr b/src/test/ui/label/label_break_value_continue.stderr index 9b8693dc584c4..284d213d65eaa 100644 --- a/src/test/ui/label/label_break_value_continue.stderr +++ b/src/test/ui/label/label_break_value_continue.stderr @@ -1,11 +1,11 @@ error[E0695]: unlabeled `continue` inside of a labeled block - --> $DIR/label_break_value_continue.rs:7:9 + --> $DIR/label_break_value_continue.rs:6:9 | LL | continue; | ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label error[E0696]: `continue` pointing to a labeled block - --> $DIR/label_break_value_continue.rs:14:9 + --> $DIR/label_break_value_continue.rs:13:9 | LL | / 'b: { LL | | continue 'b; @@ -14,7 +14,7 @@ LL | | } | |_____- labeled block the `continue` points to error[E0695]: unlabeled `continue` inside of a labeled block - --> $DIR/label_break_value_continue.rs:22:13 + --> $DIR/label_break_value_continue.rs:21:13 | LL | continue; | ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label diff --git a/src/test/ui/label/label_break_value_desugared_break.rs b/src/test/ui/label/label_break_value_desugared_break.rs index de883b61111ce..70227d869337d 100644 --- a/src/test/ui/label/label_break_value_desugared_break.rs +++ b/src/test/ui/label/label_break_value_desugared_break.rs @@ -1,5 +1,5 @@ // compile-flags: --edition 2018 -#![feature(label_break_value, try_blocks)] +#![feature(try_blocks)] // run-pass fn main() { @@ -9,4 +9,11 @@ fn main() { break 'foo; } }; + + 'foo: { + let _: Result<(), ()> = try { + Err(())?; + break 'foo; + }; + } } diff --git a/src/test/ui/label/label_break_value_illegal_uses.fixed b/src/test/ui/label/label_break_value_illegal_uses.fixed index c1d2023a21629..fb75276b4f4d1 100644 --- a/src/test/ui/label/label_break_value_illegal_uses.fixed +++ b/src/test/ui/label/label_break_value_illegal_uses.fixed @@ -1,5 +1,4 @@ // run-rustfix -#![feature(label_break_value)] // These are forbidden occurrences of label-break-value diff --git a/src/test/ui/label/label_break_value_illegal_uses.rs b/src/test/ui/label/label_break_value_illegal_uses.rs index 5b20c95e581e5..3cbf41380e6c5 100644 --- a/src/test/ui/label/label_break_value_illegal_uses.rs +++ b/src/test/ui/label/label_break_value_illegal_uses.rs @@ -1,5 +1,4 @@ // run-rustfix -#![feature(label_break_value)] // These are forbidden occurrences of label-break-value diff --git a/src/test/ui/label/label_break_value_illegal_uses.stderr b/src/test/ui/label/label_break_value_illegal_uses.stderr index 24b733fec5301..15016ffd54ab6 100644 --- a/src/test/ui/label/label_break_value_illegal_uses.stderr +++ b/src/test/ui/label/label_break_value_illegal_uses.stderr @@ -1,23 +1,23 @@ error: block label not supported here - --> $DIR/label_break_value_illegal_uses.rs:8:12 + --> $DIR/label_break_value_illegal_uses.rs:7:12 | LL | unsafe 'b: {} | ^^^ not supported here error: block label not supported here - --> $DIR/label_break_value_illegal_uses.rs:12:13 + --> $DIR/label_break_value_illegal_uses.rs:11:13 | LL | if true 'b: {} | ^^^ not supported here error: block label not supported here - --> $DIR/label_break_value_illegal_uses.rs:16:21 + --> $DIR/label_break_value_illegal_uses.rs:15:21 | LL | if true {} else 'b: {} | ^^^ not supported here error: block label not supported here - --> $DIR/label_break_value_illegal_uses.rs:20:17 + --> $DIR/label_break_value_illegal_uses.rs:19:17 | LL | match false 'b: { | ^^^ not supported here diff --git a/src/test/ui/label/label_break_value_unlabeled_break.rs b/src/test/ui/label/label_break_value_unlabeled_break.rs index fa0c70edc7881..2a4f5d57493e1 100644 --- a/src/test/ui/label/label_break_value_unlabeled_break.rs +++ b/src/test/ui/label/label_break_value_unlabeled_break.rs @@ -1,4 +1,3 @@ -#![feature(label_break_value)] #![allow(unused_labels)] // Simple unlabeled break should yield in an error diff --git a/src/test/ui/label/label_break_value_unlabeled_break.stderr b/src/test/ui/label/label_break_value_unlabeled_break.stderr index 0c4f573d27db5..a2ccd27b83663 100644 --- a/src/test/ui/label/label_break_value_unlabeled_break.stderr +++ b/src/test/ui/label/label_break_value_unlabeled_break.stderr @@ -1,11 +1,11 @@ error[E0695]: unlabeled `break` inside of a labeled block - --> $DIR/label_break_value_unlabeled_break.rs:7:9 + --> $DIR/label_break_value_unlabeled_break.rs:6:9 | LL | break; | ^^^^^ `break` statements that would diverge to or through a labeled block need to bear a label error[E0695]: unlabeled `break` inside of a labeled block - --> $DIR/label_break_value_unlabeled_break.rs:15:13 + --> $DIR/label_break_value_unlabeled_break.rs:14:13 | LL | break; | ^^^^^ `break` statements that would diverge to or through a labeled block need to bear a label diff --git a/src/test/ui/lint/unused_labels.rs b/src/test/ui/lint/unused_labels.rs index 8a3568f65f63e..87a5392fd30fd 100644 --- a/src/test/ui/lint/unused_labels.rs +++ b/src/test/ui/lint/unused_labels.rs @@ -4,7 +4,6 @@ // check-pass -#![feature(label_break_value)] #![warn(unused_labels)] fn main() { diff --git a/src/test/ui/lint/unused_labels.stderr b/src/test/ui/lint/unused_labels.stderr index 85adc9ab3bfbe..846da792bed55 100644 --- a/src/test/ui/lint/unused_labels.stderr +++ b/src/test/ui/lint/unused_labels.stderr @@ -1,5 +1,5 @@ warning: label name `'many_used_shadowed` shadows a label name that is already in scope - --> $DIR/unused_labels.rs:62:9 + --> $DIR/unused_labels.rs:61:9 | LL | 'many_used_shadowed: for _ in 0..10 { | ------------------- first declared here @@ -8,55 +8,55 @@ LL | 'many_used_shadowed: for _ in 0..10 { | ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope warning: unused label - --> $DIR/unused_labels.rs:11:5 + --> $DIR/unused_labels.rs:10:5 | LL | 'unused_while_label: while 0 == 0 { | ^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/unused_labels.rs:8:9 + --> $DIR/unused_labels.rs:7:9 | LL | #![warn(unused_labels)] | ^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:16:5 + --> $DIR/unused_labels.rs:15:5 | LL | 'unused_while_let_label: while let Some(_) = opt { | ^^^^^^^^^^^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:20:5 + --> $DIR/unused_labels.rs:19:5 | LL | 'unused_for_label: for _ in 0..10 { | ^^^^^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:36:9 + --> $DIR/unused_labels.rs:35:9 | LL | 'unused_loop_label_inner_2: for _ in 0..10 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:42:5 + --> $DIR/unused_labels.rs:41:5 | LL | 'unused_loop_label_outer_3: for _ in 0..10 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:60:5 + --> $DIR/unused_labels.rs:59:5 | LL | 'many_used_shadowed: for _ in 0..10 { | ^^^^^^^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:72:5 + --> $DIR/unused_labels.rs:71:5 | LL | 'unused_loop_label: loop { | ^^^^^^^^^^^^^^^^^^ warning: unused label - --> $DIR/unused_labels.rs:78:5 + --> $DIR/unused_labels.rs:77:5 | LL | 'unused_block_label: { | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/macros/stringify.rs b/src/test/ui/macros/stringify.rs index 082c1abb8f2f4..dd159cb5b6efc 100644 --- a/src/test/ui/macros/stringify.rs +++ b/src/test/ui/macros/stringify.rs @@ -9,7 +9,6 @@ #![feature(decl_macro)] #![feature(generators)] #![feature(half_open_range_patterns)] -#![feature(label_break_value)] #![feature(more_qualified_paths)] #![feature(raw_ref_op)] #![feature(trait_alias)] diff --git a/src/test/ui/parser/bad-interpolated-block.rs b/src/test/ui/parser/bad-interpolated-block.rs index 38d53a14bc0bc..c6d7ae383b247 100644 --- a/src/test/ui/parser/bad-interpolated-block.rs +++ b/src/test/ui/parser/bad-interpolated-block.rs @@ -1,5 +1,3 @@ -#![feature(label_break_value)] - fn main() {} macro_rules! m { diff --git a/src/test/ui/parser/bad-interpolated-block.stderr b/src/test/ui/parser/bad-interpolated-block.stderr index 77933b1bcec68..2a0999afdfaf8 100644 --- a/src/test/ui/parser/bad-interpolated-block.stderr +++ b/src/test/ui/parser/bad-interpolated-block.stderr @@ -1,5 +1,5 @@ error: cannot use a `block` macro fragment here - --> $DIR/bad-interpolated-block.rs:7:15 + --> $DIR/bad-interpolated-block.rs:5:15 | LL | 'lab: $b; | ------^^ @@ -12,7 +12,7 @@ LL | m!({}); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot use a `block` macro fragment here - --> $DIR/bad-interpolated-block.rs:8:16 + --> $DIR/bad-interpolated-block.rs:6:16 | LL | unsafe $b; | -------^^ @@ -25,7 +25,7 @@ LL | m!({}); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot use a `block` macro fragment here - --> $DIR/bad-interpolated-block.rs:9:23 + --> $DIR/bad-interpolated-block.rs:7:23 | LL | |x: u8| -> () $b; | ^^ the `block` fragment is within this context diff --git a/src/test/ui/parser/labeled-no-colon-expr.rs b/src/test/ui/parser/labeled-no-colon-expr.rs index db9ef52c1aeec..d9ebd7473bc72 100644 --- a/src/test/ui/parser/labeled-no-colon-expr.rs +++ b/src/test/ui/parser/labeled-no-colon-expr.rs @@ -1,5 +1,3 @@ -#![feature(label_break_value)] - fn main() { 'l0 while false {} //~ ERROR labeled expression must be followed by `:` 'l1 for _ in 0..1 {} //~ ERROR labeled expression must be followed by `:` diff --git a/src/test/ui/parser/labeled-no-colon-expr.stderr b/src/test/ui/parser/labeled-no-colon-expr.stderr index a258bd3ccde57..62288fe152da3 100644 --- a/src/test/ui/parser/labeled-no-colon-expr.stderr +++ b/src/test/ui/parser/labeled-no-colon-expr.stderr @@ -1,5 +1,5 @@ error: labeled expression must be followed by `:` - --> $DIR/labeled-no-colon-expr.rs:4:5 + --> $DIR/labeled-no-colon-expr.rs:2:5 | LL | 'l0 while false {} | ----^^^^^^^^^^^^^^ @@ -10,7 +10,7 @@ LL | 'l0 while false {} = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them error: labeled expression must be followed by `:` - --> $DIR/labeled-no-colon-expr.rs:5:5 + --> $DIR/labeled-no-colon-expr.rs:3:5 | LL | 'l1 for _ in 0..1 {} | ----^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ LL | 'l1 for _ in 0..1 {} = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them error: labeled expression must be followed by `:` - --> $DIR/labeled-no-colon-expr.rs:6:5 + --> $DIR/labeled-no-colon-expr.rs:4:5 | LL | 'l2 loop {} | ----^^^^^^^ @@ -32,7 +32,7 @@ LL | 'l2 loop {} = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them error: labeled expression must be followed by `:` - --> $DIR/labeled-no-colon-expr.rs:7:5 + --> $DIR/labeled-no-colon-expr.rs:5:5 | LL | 'l3 {} | ----^^ @@ -43,7 +43,7 @@ LL | 'l3 {} = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/labeled-no-colon-expr.rs:8:9 + --> $DIR/labeled-no-colon-expr.rs:6:9 | LL | 'l4 0; | ^ expected `while`, `for`, `loop` or `{` after a label @@ -55,7 +55,7 @@ LL + 0; | error: labeled expression must be followed by `:` - --> $DIR/labeled-no-colon-expr.rs:8:9 + --> $DIR/labeled-no-colon-expr.rs:6:9 | LL | 'l4 0; | ----^ @@ -66,7 +66,7 @@ LL | 'l4 0; = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them error: cannot use a `block` macro fragment here - --> $DIR/labeled-no-colon-expr.rs:13:17 + --> $DIR/labeled-no-colon-expr.rs:11:17 | LL | 'l5 $b; | ----^^ @@ -79,7 +79,7 @@ LL | m!({}); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) error: labeled expression must be followed by `:` - --> $DIR/labeled-no-colon-expr.rs:16:8 + --> $DIR/labeled-no-colon-expr.rs:14:8 | LL | 'l5 $b; | ---- help: add `:` after the label diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.fixed b/src/test/ui/parser/recover-labeled-non-block-expr.fixed index fe546a7197117..c2e76444d115e 100644 --- a/src/test/ui/parser/recover-labeled-non-block-expr.fixed +++ b/src/test/ui/parser/recover-labeled-non-block-expr.fixed @@ -1,5 +1,4 @@ // run-rustfix -#![feature(label_break_value)] fn main() { let _ = 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.rs b/src/test/ui/parser/recover-labeled-non-block-expr.rs index 35862e2eef973..fc11c646a8c68 100644 --- a/src/test/ui/parser/recover-labeled-non-block-expr.rs +++ b/src/test/ui/parser/recover-labeled-non-block-expr.rs @@ -1,5 +1,4 @@ // run-rustfix -#![feature(label_break_value)] fn main() { let _ = 'label: 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.stderr b/src/test/ui/parser/recover-labeled-non-block-expr.stderr index 04fc1203e90ed..d66ce6950904c 100644 --- a/src/test/ui/parser/recover-labeled-non-block-expr.stderr +++ b/src/test/ui/parser/recover-labeled-non-block-expr.stderr @@ -1,5 +1,5 @@ error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/recover-labeled-non-block-expr.rs:4:21 + --> $DIR/recover-labeled-non-block-expr.rs:3:21 | LL | let _ = 'label: 1 + 1; | ^ expected `while`, `for`, `loop` or `{` after a label @@ -11,7 +11,7 @@ LL + let _ = 1 + 1; | error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/recover-labeled-non-block-expr.rs:6:13 + --> $DIR/recover-labeled-non-block-expr.rs:5:13 | LL | 'label: match () { () => {}, }; | ^^^^^ expected `while`, `for`, `loop` or `{` after a label @@ -23,7 +23,7 @@ LL + match () { () => {}, }; | error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/recover-labeled-non-block-expr.rs:7:13 + --> $DIR/recover-labeled-non-block-expr.rs:6:13 | LL | 'label: match () { () => break 'label, }; | ^^^^^ expected `while`, `for`, `loop` or `{` after a label @@ -34,7 +34,7 @@ LL | 'label: { match () { () => break 'label, } }; | + + error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/recover-labeled-non-block-expr.rs:9:13 + --> $DIR/recover-labeled-non-block-expr.rs:8:13 | LL | 'label: match () { () => 'lp: loop { break 'lp 0 }, }; | ^^^^^ expected `while`, `for`, `loop` or `{` after a label @@ -45,7 +45,7 @@ LL | 'label: { match () { () => 'lp: loop { break 'lp 0 }, } }; | + + error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/recover-labeled-non-block-expr.rs:12:22 + --> $DIR/recover-labeled-non-block-expr.rs:11:22 | LL | let _i = 'label: match x { | ^^^^^ expected `while`, `for`, `loop` or `{` after a label @@ -60,7 +60,7 @@ LL ~ } }; | error: expected `while`, `for`, `loop` or `{` after a label - --> $DIR/recover-labeled-non-block-expr.rs:26:24 + --> $DIR/recover-labeled-non-block-expr.rs:25:24 | LL | let _val = 'label: (1, if other == 3 { break 'label (2, 3) } else { other }); | ^ expected `while`, `for`, `loop` or `{` after a label diff --git a/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.rs b/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.rs index 91916e7480fe1..c3235f06779b3 100644 --- a/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.rs +++ b/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.rs @@ -1,6 +1,5 @@ #![warn(clippy::semicolon_if_nothing_returned)] #![allow(clippy::redundant_closure)] -#![feature(label_break_value)] #![feature(let_else)] fn get_unit() {} diff --git a/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.stderr b/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.stderr index 41d2c1cfb87ae..78813e7cc1c39 100644 --- a/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.stderr +++ b/src/tools/clippy/tests/ui/semicolon_if_nothing_returned.stderr @@ -1,5 +1,5 @@ error: consider adding a `;` to the last statement for consistent formatting - --> $DIR/semicolon_if_nothing_returned.rs:10:5 + --> $DIR/semicolon_if_nothing_returned.rs:9:5 | LL | println!("Hello") | ^^^^^^^^^^^^^^^^^ help: add a `;` here: `println!("Hello");` @@ -7,25 +7,25 @@ LL | println!("Hello") = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D warnings` error: consider adding a `;` to the last statement for consistent formatting - --> $DIR/semicolon_if_nothing_returned.rs:14:5 + --> $DIR/semicolon_if_nothing_returned.rs:13:5 | LL | get_unit() | ^^^^^^^^^^ help: add a `;` here: `get_unit();` error: consider adding a `;` to the last statement for consistent formatting - --> $DIR/semicolon_if_nothing_returned.rs:19:5 + --> $DIR/semicolon_if_nothing_returned.rs:18:5 | LL | y = x + 1 | ^^^^^^^^^ help: add a `;` here: `y = x + 1;` error: consider adding a `;` to the last statement for consistent formatting - --> $DIR/semicolon_if_nothing_returned.rs:25:9 + --> $DIR/semicolon_if_nothing_returned.rs:24:9 | LL | hello() | ^^^^^^^ help: add a `;` here: `hello();` error: consider adding a `;` to the last statement for consistent formatting - --> $DIR/semicolon_if_nothing_returned.rs:36:9 + --> $DIR/semicolon_if_nothing_returned.rs:35:9 | LL | ptr::drop_in_place(s.as_mut_ptr()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `ptr::drop_in_place(s.as_mut_ptr());` diff --git a/src/tools/rustfmt/tests/source/issue-3217.rs b/src/tools/rustfmt/tests/source/issue-3217.rs index 176c702002a28..e68ca2c5907fc 100644 --- a/src/tools/rustfmt/tests/source/issue-3217.rs +++ b/src/tools/rustfmt/tests/source/issue-3217.rs @@ -1,5 +1,3 @@ -#![feature(label_break_value)] - fn main() { let mut res = 0; 's_39: { if res == 0i32 { println!("Hello, world!"); } } diff --git a/src/tools/rustfmt/tests/target/issue-3217.rs b/src/tools/rustfmt/tests/target/issue-3217.rs index 5121320a0975b..403bf4c340a4e 100644 --- a/src/tools/rustfmt/tests/target/issue-3217.rs +++ b/src/tools/rustfmt/tests/target/issue-3217.rs @@ -1,5 +1,3 @@ -#![feature(label_break_value)] - fn main() { let mut res = 0; 's_39: {