]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/ptr.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / ptr.rs
index bc3bc27f5d9ba11dd670855641a0c19a064d3353..167ce84f803f14897f581b8a407030b09503602d 100644 (file)
@@ -5,6 +5,8 @@
 use rustc::hir::map::NodeItem;
 use rustc::hir::QPath;
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
+use if_chain::if_chain;
 use rustc::ty;
 use syntax::ast::NodeId;
 use syntax::codemap::Span;
@@ -103,7 +105,7 @@ fn get_lints(&self) -> LintArray {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PointerPass {
     fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
-        if let ItemFn(ref decl, _, _, body_id) = item.node {
+        if let ItemKind::Fn(ref decl, _, _, body_id) = item.node {
             check_fn(cx, decl, item.id, Some(body_id));
         }
     }
@@ -111,7 +113,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
     fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
         if let ImplItemKind::Method(ref sig, body_id) = item.node {
             if let Some(NodeItem(it)) = cx.tcx.hir.find(cx.tcx.hir.get_parent(item.id)) {
-                if let ItemImpl(_, _, _, _, Some(_), _, _) = it.node {
+                if let ItemKind::Impl(_, _, _, _, Some(_), _, _) = it.node {
                     return; // ignore trait impls
                 }
             }