Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better suggestion for panic!(format!(..)) #82110

Closed
m-ou-se opened this issue Feb 14, 2021 · 0 comments · Fixed by #82113
Closed

Better suggestion for panic!(format!(..)) #82110

m-ou-se opened this issue Feb 14, 2021 · 0 comments · Fixed by #82113
Assignees
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. D-confusing Diagnostics: Confusing error or lint that should be reworked.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Feb 14, 2021

The non_fmt_panic lint should have a special case for panic!(format!(..)) to suggest panic!(..) by removing format( and ).

@m-ou-se m-ou-se added A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. D-confusing Diagnostics: Confusing error or lint that should be reworked. labels Feb 14, 2021
@m-ou-se m-ou-se self-assigned this Feb 14, 2021
HeroicKatora added a commit to HeroicKatora/image that referenced this issue Feb 14, 2021
The panic macro will change in edition2021 such that it is consistent
between core and std. Currently, only one permits a single formattable
value as the only argument. Instead, it will work more like write and
format itself. This also means that format itself is unnecessary.

Fixed like it should be suggested for: rust-lang/rust#82110
@bors bors closed this as completed in 547b3ad Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. D-confusing Diagnostics: Confusing error or lint that should be reworked.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant