mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
use span_help_and_lint() instead of span_lint_and_sugg()
This commit is contained in:
parent
b52a9bd966
commit
268ff85326
1 changed files with 2 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
use crate::utils::span_lint_and_sugg;
|
use crate::utils::span_help_and_lint;
|
||||||
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
|
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
|
||||||
use rustc::{declare_tool_lint, lint_array};
|
use rustc::{declare_tool_lint, lint_array};
|
||||||
use rustc_errors::Applicability;
|
use rustc_errors::Applicability;
|
||||||
|
@ -41,14 +41,12 @@ impl LintPass for Pass {
|
||||||
impl EarlyLintPass for Pass {
|
impl EarlyLintPass for Pass {
|
||||||
fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::Mac) {
|
fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::Mac) {
|
||||||
if mac.node.path == "dbg" {
|
if mac.node.path == "dbg" {
|
||||||
span_lint_and_sugg(
|
span_help_and_lint(
|
||||||
cx,
|
cx,
|
||||||
DBG_MACRO,
|
DBG_MACRO,
|
||||||
mac.span,
|
mac.span,
|
||||||
"`dbg!` macro is intended as a debugging tool",
|
"`dbg!` macro is intended as a debugging tool",
|
||||||
"ensure to avoid having uses of it in version control",
|
"ensure to avoid having uses of it in version control",
|
||||||
mac.node.tts.to_string(),
|
|
||||||
Applicability::MaybeIncorrect,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue