]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/utils/internal_lints.rs
Fix build
[rust.git] / clippy_lints / src / utils / internal_lints.rs
index 10d46d8894e01da8870ab2ad6ac50d86834a7d9a..226817c8e51f0f140835f9c3f2fb09926b303cd6 100644 (file)
@@ -1,9 +1,11 @@
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
 use rustc::hir::*;
+use rustc::hir;
 use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
 use crate::utils::{match_qpath, paths, span_lint};
 use syntax::symbol::LocalInternedString;
-use syntax::ast::{Crate as AstCrate, ItemKind, Name, NodeId};
+use syntax::ast::{Crate as AstCrate, ItemKind, Name};
 use syntax::codemap::Span;
 use std::collections::{HashMap, HashSet};
 
@@ -62,7 +64,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl EarlyLintPass for Clippy {
-    fn check_crate(&mut self, cx: &EarlyContext, krate: &AstCrate) {
+    fn check_crate(&mut self, cx: &EarlyContext<'_>, krate: &AstCrate) {
         if let Some(utils) = krate
             .module
             .items
@@ -117,7 +119,7 @@ fn get_lints(&self) -> LintArray {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
     fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
-        if let ItemStatic(ref ty, MutImmutable, body_id) = item.node {
+        if let hir::ItemKind::Static(ref ty, MutImmutable, body_id) = item.node {
             if is_lint_ref_type(ty) {
                 self.declared_lints.insert(item.name, item.span);
             } else if is_lint_array_type(ty) && item.name == "ARRAY" {
@@ -196,7 +198,7 @@ fn visit_expr(&mut self, expr: &'tcx Expr) {
         walk_expr(self, expr);
     }
 
-    fn visit_path(&mut self, path: &'tcx Path, _: NodeId) {
+    fn visit_path(&mut self, path: &'tcx Path, _: HirId) {
         if path.segments.len() == 1 {
             self.output.insert(path.segments[0].ident.name);
         }