]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/lint/context.rs
Fill in some missing parts in the default AST visitor
[rust.git] / src / librustc / lint / context.rs
index 9a736747d5291ea00e5c92e9da328810aaf0bd6b..f47c709e03aa2f5ebb771d26a157ae919070fbac 100644 (file)
@@ -663,12 +663,12 @@ fn visit_fn(&mut self, fk: hir_visit::FnKind<'v>, decl: &'v hir::FnDecl,
 
     fn visit_struct_def(&mut self,
                         s: &hir::StructDef,
-                        ident: ast::Ident,
+                        name: ast::Name,
                         g: &hir::Generics,
                         id: ast::NodeId) {
-        run_lints!(self, check_struct_def, late_passes, s, ident, g, id);
+        run_lints!(self, check_struct_def, late_passes, s, name, g, id);
         hir_visit::walk_struct_def(self, s);
-        run_lints!(self, check_struct_def_post, late_passes, s, ident, g, id);
+        run_lints!(self, check_struct_def_post, late_passes, s, name, g, id);
     }
 
     fn visit_struct_field(&mut self, s: &hir::StructField) {
@@ -691,8 +691,8 @@ fn visit_ty(&mut self, t: &hir::Ty) {
         hir_visit::walk_ty(self, t);
     }
 
-    fn visit_ident(&mut self, sp: Span, id: ast::Ident) {
-        run_lints!(self, check_ident, late_passes, sp, id);
+    fn visit_name(&mut self, sp: Span, name: ast::Name) {
+        run_lints!(self, check_name, late_passes, sp, name);
     }
 
     fn visit_mod(&mut self, m: &hir::Mod, s: Span, n: ast::NodeId) {
@@ -767,6 +767,11 @@ fn visit_path(&mut self, p: &hir::Path, id: ast::NodeId) {
         hir_visit::walk_path(self, p);
     }
 
+    fn visit_path_list_item(&mut self, prefix: &hir::Path, item: &hir::PathListItem) {
+        run_lints!(self, check_path_list_item, late_passes, item);
+        hir_visit::walk_path_list_item(self, prefix, item);
+    }
+
     fn visit_attribute(&mut self, attr: &ast::Attribute) {
         run_lints!(self, check_attribute, late_passes, attr);
     }
@@ -893,12 +898,8 @@ fn visit_impl_item(&mut self, impl_item: &ast::ImplItem) {
         });
     }
 
-    fn visit_opt_lifetime_ref(&mut self, sp: Span, lt: &Option<ast::Lifetime>) {
-        run_lints!(self, check_opt_lifetime_ref, early_passes, sp, lt);
-    }
-
-    fn visit_lifetime_ref(&mut self, lt: &ast::Lifetime) {
-        run_lints!(self, check_lifetime_ref, early_passes, lt);
+    fn visit_lifetime(&mut self, lt: &ast::Lifetime) {
+        run_lints!(self, check_lifetime, early_passes, lt);
     }
 
     fn visit_lifetime_def(&mut self, lt: &ast::LifetimeDef) {
@@ -915,6 +916,11 @@ fn visit_path(&mut self, p: &ast::Path, id: ast::NodeId) {
         ast_visit::walk_path(self, p);
     }
 
+    fn visit_path_list_item(&mut self, prefix: &ast::Path, item: &ast::PathListItem) {
+        run_lints!(self, check_path_list_item, early_passes, item);
+        ast_visit::walk_path_list_item(self, prefix, item);
+    }
+
     fn visit_attribute(&mut self, attr: &ast::Attribute) {
         run_lints!(self, check_attribute, early_passes, attr);
     }