-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Unnecessary "{}" suggestion for panic with const string #82026
Comments
This isn't #78088's warning, it's #81645's. And I don't think it's incorrect; only literals, not expressions can be used as format strings, even if the expression is evaluable at compile time. e.g. this doesn't work: const FORMAT: &str = "{}";
fn main() {
panic!(FORMAT, "Hello");
} And indeed the code given does not compile in the 2021 edition. |
@SNCPlay42 Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#78088 implements suggestion for panic with first argument not literal, but forget to handle such code:
This code is actually legit., but
non_fmt_panic
suggestion is emitted.Check: https://gist.github.com/6002a4f7fedfda0e615d0b1158015eee
The text was updated successfully, but these errors were encountered: