11warning: panic message contains a brace
2- --> $DIR/panic-brace.rs:5:5
2+ --> $DIR/panic-brace.rs:8:29
33 |
44LL | panic!("here's a brace: {");
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
5+ | ^
66 |
77 = note: `#[warn(panic_fmt)]` on by default
88 = note: this message is not used as a format string, but will be in a future Rust version
@@ -12,10 +12,10 @@ LL | panic!("{}", "here's a brace: {");
1212 | ^^^^^
1313
1414warning: panic message contains a brace
15- --> $DIR/panic-brace.rs:6:5
15+ --> $DIR/panic-brace.rs:9:31
1616 |
1717LL | std::panic!("another one: }");
18- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
18+ | ^
1919 |
2020 = note: this message is not used as a format string, but will be in a future Rust version
2121help: add a "{}" format string to use the message literally
@@ -24,7 +24,7 @@ LL | std::panic!("{}", "another one: }");
2424 | ^^^^^
2525
2626warning: panic message contains an unused formatting placeholder
27- --> $DIR/panic-brace.rs:7 :25
27+ --> $DIR/panic-brace.rs:10 :25
2828 |
2929LL | core::panic!("Hello {}");
3030 | ^^
@@ -40,7 +40,7 @@ LL | core::panic!("{}", "Hello {}");
4040 | ^^^^^
4141
4242warning: panic message contains unused formatting placeholders
43- --> $DIR/panic-brace.rs:8 :21
43+ --> $DIR/panic-brace.rs:11 :21
4444 |
4545LL | assert!(false, "{:03x} {test} bla");
4646 | ^^^^^^ ^^^^^^
@@ -55,17 +55,45 @@ help: or add a "{}" format string to use the message literally
5555LL | assert!(false, "{}", "{:03x} {test} bla");
5656 | ^^^^^
5757
58- warning: panic message contains a brace
59- --> $DIR/panic-brace.rs:9:5
58+ warning: panic message contains braces
59+ --> $DIR/panic-brace.rs:13:27
6060 |
6161LL | debug_assert!(false, "{{}} bla");
62- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
62+ | ^^^^
6363 |
6464 = note: this message is not used as a format string, but will be in a future Rust version
6565help: add a "{}" format string to use the message literally
6666 |
6767LL | debug_assert!(false, "{}", "{{}} bla");
6868 | ^^^^^
6969
70- warning: 5 warnings emitted
70+ warning: panic message contains an unused formatting placeholder
71+ --> $DIR/panic-brace.rs:16:12
72+ |
73+ LL | panic!(concat!("{", "}"));
74+ | ^^^^^^^^^^^^^^^^^
75+ |
76+ = note: this message is not used as a format string when given without arguments, but will be in a future Rust version
77+ help: add the missing argument(s)
78+ |
79+ LL | panic!(concat!("{", "}"), ...);
80+ | ^^^^^
81+ help: or add a "{}" format string to use the message literally
82+ |
83+ LL | panic!("{}", concat!("{", "}"));
84+ | ^^^^^
85+
86+ warning: panic message contains braces
87+ --> $DIR/panic-brace.rs:17:5
88+ |
89+ LL | panic!(concat!("{", "{"));
90+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
91+ |
92+ = note: this message is not used as a format string, but will be in a future Rust version
93+ help: add a "{}" format string to use the message literally
94+ |
95+ LL | panic!("{}", concat!("{", "{"));
96+ | ^^^^^
97+
98+ warning: 7 warnings emitted
7199
0 commit comments