False positive literal_string_with_formatting_args
for non-static templete string expansion with replace.
#13989
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
When I write code expanding dynamically changed template string, I encountered
literal_string_with_formatting_args
.I think calling
replace("{var}", &var)
is likely to be intended to not treat as format string in rust.Lint Name
literal_string_with_formatting_args
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No lint for this code.
Version
Additional Labels
the commit message and description of PR adds
literal_string_with_formatting_args
saysliteral_string_with_formatting_args
ispedantic
so it might be it's a bug thatliteral_string_with_formatting_args
is categorized assuspicious
;According to the edit history of the PR description, it's originally categorized as
suspicious
and changed topedantic
later, but code has not changed (or rebase miss in some point).When I searched on github, I can see the thousands of similar false positive cases are exists.
The text was updated successfully, but these errors were encountered: