]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/derive.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / derive.rs
index 0c544c69d0977424230def68a7507a9d26087c8a..0689ef25c20715c0fbb8179c05efb6a1070afe94 100644 (file)
@@ -1,9 +1,11 @@
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
+use if_chain::if_chain;
 use rustc::ty::{self, Ty};
 use rustc::hir::*;
 use syntax::codemap::Span;
-use utils::paths;
-use utils::{is_automatically_derived, is_copy, match_path, span_lint_and_then};
+use crate::utils::paths;
+use crate::utils::{is_automatically_derived, is_copy, match_path, span_lint_and_then};
 
 /// **What it does:** Checks for deriving `Hash` but implementing `PartialEq`
 /// explicitly or vice versa.
@@ -70,7 +72,7 @@ fn get_lints(&self) -> LintArray {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
     fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
-        if let ItemImpl(_, _, _, _, Some(ref trait_ref), _, _) = item.node {
+        if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.node {
             let ty = cx.tcx.type_of(cx.tcx.hir.local_def_id(item.id));
             let is_automatically_derived = is_automatically_derived(&*item.attrs);