Don't emit if literal comes from macro expansion
This commit is contained in:
parent
9ea769a479
commit
b20b75a904
1 changed files with 3 additions and 0 deletions
|
|
@ -37,6 +37,9 @@ declare_lint_pass!(LiteralStringWithFormattingArg => [LITERAL_STRING_WITH_FORMAT
|
|||
|
||||
impl EarlyLintPass for LiteralStringWithFormattingArg {
|
||||
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
|
||||
if expr.span.from_expansion() {
|
||||
return;
|
||||
}
|
||||
if let ExprKind::Lit(lit) = expr.kind {
|
||||
let add = match lit.kind {
|
||||
LitKind::Str => 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue