mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
Make suggestion Applicability::MachineApplicable
This commit is contained in:
parent
9a6216ed05
commit
752724546a
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use crate::rustc_errors::Applicability;
|
||||
use crate::rustc::hir::*;
|
||||
use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||
use crate::rustc::{declare_tool_lint, lint_array};
|
||||
|
@ -101,7 +102,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||
dest_name
|
||||
),
|
||||
"try this",
|
||||
format!("{}{}!(\"{}\")", prefix, macro_name.replace("write", "print"), write_output.escape_default())
|
||||
format!("{}{}!(\"{}\")", prefix, macro_name.replace("write", "print"), write_output.escape_default()),
|
||||
Applicability::MachineApplicable
|
||||
);
|
||||
} else {
|
||||
span_lint_and_sugg(
|
||||
|
@ -110,7 +112,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||
expr.span,
|
||||
&format!("use of `{}().write_fmt(...).unwrap()`", dest_name),
|
||||
"try this",
|
||||
format!("{}print!(\"{}\")", prefix, write_output.escape_default())
|
||||
format!("{}print!(\"{}\")", prefix, write_output.escape_default()),
|
||||
Applicability::MachineApplicable
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue