-use crate::utils::{in_macro_or_desugar, snippet_with_applicability, span_lint_and_sugg};
+use crate::utils::{snippet_with_applicability, span_lint_and_sugg};
+use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
impl EarlyLintPass for Precedence {
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
impl EarlyLintPass for Precedence {
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
- if let ExprKind::Binary(Spanned { node: op, .. }, ref left, ref right) = expr.node {
+ if let ExprKind::Binary(Spanned { node: op, .. }, ref left, ref right) = expr.kind {
- if let ExprKind::Unary(UnOp::Neg, ref rhs) = expr.node {
- if let ExprKind::MethodCall(_, ref args) = rhs.node {
+ if let ExprKind::Unary(UnOp::Neg, ref rhs) = expr.kind {
+ if let ExprKind::MethodCall(_, ref args) = rhs.kind {
- if let ExprKind::Lit(ref lit) = slf.node {
- match lit.node {
- LitKind::Int(..) | LitKind::Float(..) | LitKind::FloatUnsuffixed(..) => {
+ if let ExprKind::Lit(ref lit) = slf.kind {
+ match lit.kind {
+ LitKind::Int(..) | LitKind::Float(..) => {
ExprKind::Binary(Spanned { node: op, .. }, _, _) => is_arith_op(op),
_ => false,
}
}
ExprKind::Binary(Spanned { node: op, .. }, _, _) => is_arith_op(op),
_ => false,
}
}