]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/neg_cmp_op_on_partial_ord.rs
rustup https://github.com/rust-lang/rust/pull/67455
[rust.git] / clippy_lints / src / neg_cmp_op_on_partial_ord.rs
index 7cc1b576cfa80dd87aeff2525b085748a285c106..432d2552f2fee43e668305f90da3bb6541bf5a4e 100644 (file)
@@ -1,7 +1,8 @@
 use if_chain::if_chain;
+use rustc::declare_lint_pass;
 use rustc::hir::*;
 use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
-use rustc::{declare_lint_pass, declare_tool_lint};
+use rustc_session::declare_tool_lint;
 
 use crate::utils::{self, paths, span_lint};
 
@@ -49,8 +50,8 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_chain! {
 
             if !in_external_macro(cx.sess(), expr.span);
-            if let ExprKind::Unary(UnOp::UnNot, ref inner) = expr.node;
-            if let ExprKind::Binary(ref op, ref left, _) = inner.node;
+            if let ExprKind::Unary(UnOp::UnNot, ref inner) = expr.kind;
+            if let ExprKind::Binary(ref op, ref left, _) = inner.kind;
             if let BinOpKind::Le | BinOpKind::Ge | BinOpKind::Lt | BinOpKind::Gt = op.node;
 
             then {
@@ -58,7 +59,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
                 let ty = cx.tables.expr_ty(left);
 
                 let implements_ord = {
-                    if let Some(id) = utils::get_trait_def_id(cx, &*paths::ORD) {
+                    if let Some(id) = utils::get_trait_def_id(cx, &paths::ORD) {
                         utils::implements_trait(cx, ty, id, &[])
                     } else {
                         return;
@@ -66,7 +67,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
                 };
 
                 let implements_partial_ord = {
-                    if let Some(id) = utils::get_trait_def_id(cx, &*paths::PARTIAL_ORD) {
+                    if let Some(id) = utils::get_trait_def_id(cx, &paths::PARTIAL_ORD) {
                         utils::implements_trait(cx, ty, id, &[])
                     } else {
                         return;