]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/feature_gate/check.rs
Revert "pre-expansion gate box_patterns"
[rust.git] / src / libsyntax / feature_gate / check.rs
index 7c5b75387d2debb5075511a2ef2edcc63922b565..33dfe386a4d069d55534952efaccc263f935fe30 100644 (file)
@@ -533,6 +533,10 @@ fn visit_expr(&mut self, e: &'a ast::Expr) {
         visit::walk_expr(self, e)
     }
 
+    fn visit_arm(&mut self, arm: &'a ast::Arm) {
+        visit::walk_arm(self, arm)
+    }
+
     fn visit_pat(&mut self, pattern: &'a ast::Pat) {
         match &pattern.kind {
             PatKind::Slice(pats) => {
@@ -552,6 +556,11 @@ fn visit_pat(&mut self, pattern: &'a ast::Pat) {
                     }
                 }
             }
+            PatKind::Box(..) => {
+                gate_feature_post!(&self, box_patterns,
+                                  pattern.span,
+                                  "box pattern syntax is experimental");
+            }
             PatKind::Range(_, _, Spanned { node: RangeEnd::Excluded, .. }) => {
                 gate_feature_post!(&self, exclusive_range_pattern, pattern.span,
                                    "exclusive range pattern syntax is experimental");
@@ -561,7 +570,11 @@ fn visit_pat(&mut self, pattern: &'a ast::Pat) {
         visit::walk_pat(self, pattern)
     }
 
-    fn visit_fn(&mut self, fn_kind: FnKind<'a>, fn_decl: &'a ast::FnDecl, span: Span, _: NodeId) {
+    fn visit_fn(&mut self,
+                fn_kind: FnKind<'a>,
+                fn_decl: &'a ast::FnDecl,
+                span: Span,
+                _node_id: NodeId) {
         if let Some(header) = fn_kind.header() {
             // Stability of const fn methods are covered in
             // `visit_trait_item` and `visit_impl_item` below; this is