]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_ast_passes/feature_gate.rs
parse extern consts
[rust.git] / src / librustc_ast_passes / feature_gate.rs
index 0b21de4d78b41a513258f823baae67efbf956990..d4de2c937583db5ba44005bf7d444a9f76521fae 100644 (file)
@@ -397,10 +397,10 @@ fn visit_foreign_item(&mut self, i: &'a ast::ForeignItem) {
                     );
                 }
             }
-            ast::ForeignItemKind::Ty => {
+            ast::ForeignItemKind::TyAlias(..) => {
                 gate_feature_post!(&self, extern_types, i.span, "extern types are experimental");
             }
-            ast::ForeignItemKind::Macro(..) => {}
+            ast::ForeignItemKind::Macro(..) | ast::ForeignItemKind::Const(..) => {}
         }
 
         visit::walk_foreign_item(self, i)
@@ -548,12 +548,12 @@ fn visit_assoc_item(&mut self, i: &'a ast::AssocItem, ctxt: AssocCtxt) {
         }
 
         match i.kind {
-            ast::AssocItemKind::Fn(ref sig, _) => {
+            ast::AssocItemKind::Fn(ref sig, _, _) => {
                 if let (ast::Const::Yes(_), AssocCtxt::Trait) = (sig.header.constness, ctxt) {
                     gate_feature_post!(&self, const_fn, i.span, "const fn is unstable");
                 }
             }
-            ast::AssocItemKind::TyAlias(_, ref ty) => {
+            ast::AssocItemKind::TyAlias(ref generics, _, ref ty) => {
                 if let (Some(_), AssocCtxt::Trait) = (ty, ctxt) {
                     gate_feature_post!(
                         &self,
@@ -565,7 +565,7 @@ fn visit_assoc_item(&mut self, i: &'a ast::AssocItem, ctxt: AssocCtxt) {
                 if let Some(ty) = ty {
                     self.check_impl_trait(ty);
                 }
-                self.check_gat(&i.generics, i.span);
+                self.check_gat(generics, i.span);
             }
             _ => {}
         }