1 use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
2 use rustc::{declare_tool_lint, lint_array};
3 use crate::utils::span_lint;
6 /// **What it does:** Checks for usage of dbg!() macro not to have it in
9 /// **Why is this bad?** `dbg!` macro is intended as a debugging tool.
11 /// **Known problems:** None.
21 declare_clippy_lint! {
24 "`dbg!` macro is intended as a debugging tool"
27 #[derive(Copy, Clone, Debug)]
30 impl LintPass for Pass {
31 fn get_lints(&self) -> LintArray {
32 lint_array!(DBG_MACRO)
35 fn name(&self) -> &'static str {
40 impl EarlyLintPass for Pass {
41 fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::Mac) {
42 if mac.node.path == "dbg" {
47 "`dbg!` macro is intended as a debugging tool. ensure to avoid having uses of it in version control",