]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/if_not_else.rs
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / clippy_lints / src / if_not_else.rs
index 9b6e243f5f044a61bf3271120e659cb84e22ba6a..b86d2e766566bd16391dde7b738d288d873050ac 100644 (file)
@@ -1,9 +1,9 @@
 //! lint on if branches that could be swapped so no `!` operation is necessary
 //! on the condition
 
-use rustc::lint::in_external_macro;
 use rustc_ast::ast::{BinOpKind, Expr, ExprKind, UnOp};
 use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
+use rustc_middle::lint::in_external_macro;
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 
 use crate::utils::span_lint_and_help;
@@ -60,7 +60,8 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, item: &Expr) {
                             cx,
                             IF_NOT_ELSE,
                             item.span,
-                            "Unnecessary boolean `not` operation",
+                            "unnecessary boolean `not` operation",
+                            None,
                             "remove the `!` and swap the blocks of the `if`/`else`",
                         );
                     },
@@ -69,7 +70,8 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, item: &Expr) {
                             cx,
                             IF_NOT_ELSE,
                             item.span,
-                            "Unnecessary `!=` operation",
+                            "unnecessary `!=` operation",
+                            None,
                             "change to `==` and swap the blocks of the `if`/`else`",
                         );
                     },