]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/let_underscore.rs
Rustup to rust-lang/rust#67806
[rust.git] / clippy_lints / src / let_underscore.rs
index 2b59b7c6b4aa33c096ca39d5794e9de7ed9d52b4..62efcb6b65c599c4488adb9536801b4745aefeb1 100644 (file)
@@ -1,8 +1,7 @@
 use if_chain::if_chain;
-use rustc::declare_lint_pass;
-use rustc::hir::*;
-use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc_session::declare_tool_lint;
+use rustc::lint::{LateContext, LateLintPass};
+use rustc_hir::*;
+use rustc_session::{declare_lint_pass, declare_tool_lint};
 
 use crate::utils::{is_must_use_func_call, is_must_use_ty, span_help_and_lint};
 
     /// ```
     pub LET_UNDERSCORE_MUST_USE,
     restriction,
-    "non-binding let on a #[must_use] expression"
+    "non-binding let on a `#[must_use]` expression"
 }
 
 declare_lint_pass!(LetUnderscore => [LET_UNDERSCORE_MUST_USE]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetUnderscore {
-    fn check_stmt(&mut self, cx: &LateContext<'_, '_>, stmt: &Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext<'_, '_>, stmt: &Stmt<'_>) {
         if_chain! {
             if let StmtKind::Local(ref local) = stmt.kind;
             if let PatKind::Wild = local.pat.kind;
@@ -44,7 +43,7 @@ fn check_stmt(&mut self, cx: &LateContext<'_, '_>, stmt: &Stmt) {
                         cx,
                         LET_UNDERSCORE_MUST_USE,
                         stmt.span,
-                        "non-binding let on an expression with #[must_use] type",
+                        "non-binding let on an expression with `#[must_use]` type",
                         "consider explicitly using expression value"
                     )
                 } else if is_must_use_func_call(cx, init) {
@@ -52,7 +51,7 @@ fn check_stmt(&mut self, cx: &LateContext<'_, '_>, stmt: &Stmt) {
                         cx,
                         LET_UNDERSCORE_MUST_USE,
                         stmt.span,
-                        "non-binding let on a result of a #[must_use] function",
+                        "non-binding let on a result of a `#[must_use]` function",
                         "consider explicitly using function result"
                     )
                 }