-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly handle expanded macros for `literal_string_with_formatting_…
…args` lint
- Loading branch information
1 parent
17f9344
commit a7fb37c
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Regression test for <https://github.com/rust-lang/rust-clippy/issues/13885>. | ||
// The `dbg` macro generates a literal with the name of the current file, so | ||
// we need to ensure the lint is not emitted in this case. | ||
|
||
#![crate_name = "foo"] | ||
#![allow(unused)] | ||
#![warn(clippy::literal_string_with_formatting_args)] | ||
|
||
fn another_bad() { | ||
let literal_string_with_formatting_args = 0; | ||
dbg!("something"); | ||
} | ||
|
||
fn main() {} |