]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/ptr.rs
Auto merge of #4809 - iankronquist:patch-1, r=flip1995
[rust.git] / clippy_lints / src / ptr.rs
index e1c54f6ed377067befb56fed09aa2e9933e214ff..445f065aaced22c33aa7a6c9f99a4e1823507249 100644 (file)
@@ -6,13 +6,12 @@
     walk_ptrs_hir_ty,
 };
 use if_chain::if_chain;
-use rustc::declare_lint_pass;
-use rustc::hir::QPath;
-use rustc::hir::*;
-use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
 use rustc::ty;
 use rustc_errors::Applicability;
-use rustc_session::declare_tool_lint;
+use rustc_hir::QPath;
+use rustc_hir::*;
+use rustc_lint::{LateContext, LateLintPass};
+use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::source_map::Span;
 use rustc_span::{MultiSpan, Symbol};
 use std::borrow::Cow;
@@ -111,7 +110,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem<'
         if let ImplItemKind::Method(ref sig, body_id) = item.kind {
             let parent_item = cx.tcx.hir().get_parent_item(item.hir_id);
             if let Some(Node::Item(it)) = cx.tcx.hir().find(parent_item) {
-                if let ItemKind::Impl(_, _, _, _, Some(_), _, _) = it.kind {
+                if let ItemKind::Impl { of_trait: Some(_), .. } = it.kind {
                     return; // ignore trait impls
                 }
             }
@@ -137,7 +136,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>) {
                     cx,
                     CMP_NULL,
                     expr.span,
-                    "Comparing with null is better expressed by the .is_null() method",
+                    "Comparing with null is better expressed by the `.is_null()` method",
                 );
             }
         }