-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
false negative write_with_newline: format string that starts with \n #8741
Copy link
Copy link
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn'tgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
Activity
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn'tgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Summary
If a format string starts with a
\n, the lint does not seem to fire.I had a quick glance at the lint code but I didn't see anything that would indicate that this is intentional.
Lint Name
clippy::write_with_newline
Reproducer
I tried this code:
would expect a warning here since we can write
writeln!(s, "\n{}")Version