Improve panic_fmt lint messages.
(From the PR feedback.) Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
This commit is contained in:
parent
5cefc3ce41
commit
9743f67684
2 changed files with 15 additions and 15 deletions
|
|
@ -5,7 +5,7 @@ LL | panic!("here's a brace: {");
|
|||
| ^
|
||||
|
|
||||
= note: `#[warn(panic_fmt)]` on by default
|
||||
= note: this message is not used as a format string, but will be in a future Rust version
|
||||
= note: this message is not used as a format string, but will be in a future Rust edition
|
||||
help: add a "{}" format string to use the message literally
|
||||
|
|
||||
LL | panic!("{}", "here's a brace: {");
|
||||
|
|
@ -17,7 +17,7 @@ warning: panic message contains a brace
|
|||
LL | std::panic!("another one: }");
|
||||
| ^
|
||||
|
|
||||
= note: this message is not used as a format string, but will be in a future Rust version
|
||||
= note: this message is not used as a format string, but will be in a future Rust edition
|
||||
help: add a "{}" format string to use the message literally
|
||||
|
|
||||
LL | std::panic!("{}", "another one: }");
|
||||
|
|
@ -29,8 +29,8 @@ warning: panic message contains an unused formatting placeholder
|
|||
LL | core::panic!("Hello {}");
|
||||
| ^^
|
||||
|
|
||||
= note: this message is not used as a format string when given without arguments, but will be in a future Rust version
|
||||
help: add the missing argument(s)
|
||||
= note: this message is not used as a format string when given without arguments, but will be in a future Rust edition
|
||||
help: add the missing argument
|
||||
|
|
||||
LL | core::panic!("Hello {}", ...);
|
||||
| ^^^^^
|
||||
|
|
@ -45,8 +45,8 @@ warning: panic message contains unused formatting placeholders
|
|||
LL | assert!(false, "{:03x} {test} bla");
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
|
||||
= note: this message is not used as a format string when given without arguments, but will be in a future Rust version
|
||||
help: add the missing argument(s)
|
||||
= note: this message is not used as a format string when given without arguments, but will be in a future Rust edition
|
||||
help: add the missing arguments
|
||||
|
|
||||
LL | assert!(false, "{:03x} {test} bla", ...);
|
||||
| ^^^^^
|
||||
|
|
@ -61,7 +61,7 @@ warning: panic message contains braces
|
|||
LL | debug_assert!(false, "{{}} bla");
|
||||
| ^^^^
|
||||
|
|
||||
= note: this message is not used as a format string, but will be in a future Rust version
|
||||
= note: this message is not used as a format string, but will be in a future Rust edition
|
||||
help: add a "{}" format string to use the message literally
|
||||
|
|
||||
LL | debug_assert!(false, "{}", "{{}} bla");
|
||||
|
|
@ -73,8 +73,8 @@ warning: panic message contains an unused formatting placeholder
|
|||
LL | panic!(concat!("{", "}"));
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this message is not used as a format string when given without arguments, but will be in a future Rust version
|
||||
help: add the missing argument(s)
|
||||
= note: this message is not used as a format string when given without arguments, but will be in a future Rust edition
|
||||
help: add the missing argument
|
||||
|
|
||||
LL | panic!(concat!("{", "}"), ...);
|
||||
| ^^^^^
|
||||
|
|
@ -89,7 +89,7 @@ warning: panic message contains braces
|
|||
LL | panic!(concat!("{", "{"));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this message is not used as a format string, but will be in a future Rust version
|
||||
= note: this message is not used as a format string, but will be in a future Rust edition
|
||||
help: add a "{}" format string to use the message literally
|
||||
|
|
||||
LL | panic!("{}", concat!("{", "{"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue