]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/panic_unimplemented.rs
Rollup merge of #82917 - cuviper:iter-zip, r=m-ou-se
[rust.git] / clippy_lints / src / panic_unimplemented.rs
index 31b03ecd101c09daaab92d96f992521fc3cb5166..d06e7f8fe1e0e58eef7f89cf37700c67da0d67bc 100644 (file)
@@ -1,4 +1,5 @@
-use crate::utils::{is_expn_of, match_panic_call, span_lint};
+use clippy_utils::diagnostics::span_lint;
+use clippy_utils::{is_expn_of, match_panic_call};
 use if_chain::if_chain;
 use rustc_hir::Expr;
 use rustc_lint::{LateContext, LateLintPass};
@@ -66,7 +67,7 @@
     /// ```
     pub UNREACHABLE,
     restriction,
-    "`unreachable!` should not be present in production code"
+    "usage of the `unreachable!` macro"
 }
 
 declare_lint_pass!(PanicUnimplemented => [UNIMPLEMENTED, UNREACHABLE, TODO, PANIC]);
@@ -85,12 +86,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
             } else if is_expn_of(expr.span, "todo").is_some() {
                 span_lint(cx, TODO, span, "`todo` should not be present in production code");
             } else if is_expn_of(expr.span, "unreachable").is_some() {
-                span_lint(
-                    cx,
-                    UNREACHABLE,
-                    span,
-                    "`unreachable` should not be present in production code",
-                );
+                span_lint(cx, UNREACHABLE, span, "usage of the `unreachable!` macro");
             } else if is_expn_of(expr.span, "panic").is_some() {
                 span_lint(cx, PANIC, span, "`panic` should not be present in production code");
             }