about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2018-05-12 11:33:33 +0200
committerest31 <MTest31@outlook.com>2018-05-16 13:58:41 +0200
commitdfa98318e17bc1c42615fd02efe946bfb8dfeb7c (patch)
treec4e25fb0294442bd8d531e037b7673e16daa6f0e /src/libsyntax
parent128f2b5870cb5e6a01ec06bbee4f150b4ca6c19d (diff)
downloadrust-dfa98318e17bc1c42615fd02efe946bfb8dfeb7c.tar.gz
rust-dfa98318e17bc1c42615fd02efe946bfb8dfeb7c.zip
Add feature gate label_break_value
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index bf78723e413..f1229520c77 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -466,6 +466,9 @@ declare_features! (
 
     // inconsistent bounds in where clauses
     (active, trivial_bounds, "1.28.0", Some(48214), None),
+
+    // 'a: { break 'a; }
+    (active, label_break_value, "1.28.0", Some(48594), None),
 );
 
 declare_features! (
@@ -1696,6 +1699,12 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                                     "multiple patterns in `if let` and `while let` are unstable");
                 }
             }
+            ast::ExprKind::Block(_, opt_label) => {
+                if let Some(label) = opt_label {
+                    gate_feature_post!(&self, label_break_value, label.ident.span,
+                                    "labels on blocks are unstable");
+                }
+            }
             _ => {}
         }
         visit::walk_expr(self, e);