X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_lints%2Fsrc%2Fidentity_op.rs;h=a4575c2c38fa2a37176b42f545351902bead4419;hb=e5a5b0a0774625eebbe7b29c67b49dc6431544d1;hp=55f8701ab18bbd4c81bd4c1610b965924c07a2f7;hpb=6d9ee9e5eba16612bb2fc253f77673b823812b8a;p=rust.git diff --git a/clippy_lints/src/identity_op.rs b/clippy_lints/src/identity_op.rs index 55f8701ab18..a4575c2c38f 100644 --- a/clippy_lints/src/identity_op.rs +++ b/clippy_lints/src/identity_op.rs @@ -1,7 +1,8 @@ +use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; -use rustc::{declare_lint_pass, declare_tool_lint}; +use rustc_session::declare_tool_lint; use syntax::source_map::Span; use crate::consts::{constant_simple, Constant}; @@ -32,7 +33,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) { if e.span.from_expansion() { return; } - if let ExprKind::Binary(ref cmp, ref left, ref right) = e.node { + if let ExprKind::Binary(ref cmp, ref left, ref right) = e.kind { match cmp.node { BinOpKind::Add | BinOpKind::BitOr | BinOpKind::BitXor => { check(cx, left, 0, e.span, right.span); @@ -57,7 +58,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) { #[allow(clippy::cast_possible_wrap)] fn check(cx: &LateContext<'_, '_>, e: &Expr, m: i8, span: Span, arg: Span) { if let Some(Constant::Int(v)) = constant_simple(cx, cx.tables, e) { - let check = match cx.tables.expr_ty(e).sty { + let check = match cx.tables.expr_ty(e).kind { ty::Int(ity) => unsext(cx.tcx, -1_i128, ity), ty::Uint(uty) => clip(cx.tcx, !0, uty), _ => return,