1 warning: panic message contains a brace
2 --> $DIR/non-fmt-panic.rs:11:29
4 LL | panic!("here's a brace: {");
7 = note: `#[warn(non_fmt_panic)]` on by default
8 = note: this message is not used as a format string, but will be in Rust 2021
9 help: add a "{}" format string to use the message literally
11 LL | panic!("{}", "here's a brace: {");
14 warning: panic message contains a brace
15 --> $DIR/non-fmt-panic.rs:12:31
17 LL | std::panic!("another one: }");
20 = note: this message is not used as a format string, but will be in Rust 2021
21 help: add a "{}" format string to use the message literally
23 LL | std::panic!("{}", "another one: }");
26 warning: panic message contains an unused formatting placeholder
27 --> $DIR/non-fmt-panic.rs:13:25
29 LL | core::panic!("Hello {}");
32 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
33 help: add the missing argument
35 LL | core::panic!("Hello {}", ...);
37 help: or add a "{}" format string to use the message literally
39 LL | core::panic!("{}", "Hello {}");
42 warning: panic message contains unused formatting placeholders
43 --> $DIR/non-fmt-panic.rs:14:21
45 LL | assert!(false, "{:03x} {test} bla");
48 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
49 help: add the missing arguments
51 LL | assert!(false, "{:03x} {test} bla", ...);
53 help: or add a "{}" format string to use the message literally
55 LL | assert!(false, "{}", "{:03x} {test} bla");
58 warning: panic message is not a string literal
59 --> $DIR/non-fmt-panic.rs:16:20
61 LL | assert!(false, S);
64 = note: this is no longer accepted in Rust 2021
65 help: add a "{}" format string to Display the message
67 LL | assert!(false, "{}", S);
70 warning: panic message contains braces
71 --> $DIR/non-fmt-panic.rs:18:27
73 LL | debug_assert!(false, "{{}} bla");
76 = note: this message is not used as a format string, but will be in Rust 2021
77 help: add a "{}" format string to use the message literally
79 LL | debug_assert!(false, "{}", "{{}} bla");
82 warning: panic message is not a string literal
83 --> $DIR/non-fmt-panic.rs:19:12
88 = note: this is no longer accepted in Rust 2021
89 help: add a "{}" format string to Display the message
93 help: or use std::panic::panic_any instead
95 LL | std::panic::panic_any(C);
96 | ^^^^^^^^^^^^^^^^^^^^^
98 warning: panic message is not a string literal
99 --> $DIR/non-fmt-panic.rs:20:12
104 = note: this is no longer accepted in Rust 2021
105 help: add a "{}" format string to Display the message
107 LL | panic!("{}", S);
109 help: or use std::panic::panic_any instead
111 LL | std::panic::panic_any(S);
112 | ^^^^^^^^^^^^^^^^^^^^^
114 warning: panic message is not a string literal
115 --> $DIR/non-fmt-panic.rs:21:17
117 LL | std::panic!(123);
120 = note: this is no longer accepted in Rust 2021
121 help: add a "{}" format string to Display the message
123 LL | std::panic!("{}", 123);
125 help: or use std::panic::panic_any instead
127 LL | std::panic::panic_any(123);
128 | ^^^^^^^^^^^^^^^^^^^^^
130 warning: panic message is not a string literal
131 --> $DIR/non-fmt-panic.rs:22:18
133 LL | core::panic!(&*"abc");
136 = note: this is no longer accepted in Rust 2021
137 help: add a "{}" format string to Display the message
139 LL | core::panic!("{}", &*"abc");
142 warning: panic message contains an unused formatting placeholder
143 --> $DIR/non-fmt-panic.rs:23:12
145 LL | panic!(concat!("{", "}"));
148 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
149 help: add the missing argument
151 LL | panic!(concat!("{", "}"), ...);
153 help: or add a "{}" format string to use the message literally
155 LL | panic!("{}", concat!("{", "}"));
158 warning: panic message contains braces
159 --> $DIR/non-fmt-panic.rs:24:5
161 LL | panic!(concat!("{", "{"));
162 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
164 = note: this message is not used as a format string, but will be in Rust 2021
165 help: add a "{}" format string to use the message literally
167 LL | panic!("{}", concat!("{", "{"));
170 warning: panic message contains an unused formatting placeholder
171 --> $DIR/non-fmt-panic.rs:26:37
173 LL | fancy_panic::fancy_panic!("test {} 123");
176 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
178 warning: panic message is not a string literal
179 --> $DIR/non-fmt-panic.rs:29:31
181 LL | fancy_panic::fancy_panic!(S);
184 = note: this is no longer accepted in Rust 2021
186 warning: panic message is not a string literal
187 --> $DIR/non-fmt-panic.rs:36:12
192 = note: this is no longer accepted in Rust 2021
193 help: add a "{}" format string to Display the message
195 LL | panic!("{}", a!());
197 help: or use std::panic::panic_any instead
199 LL | std::panic::panic_any(a!());
200 | ^^^^^^^^^^^^^^^^^^^^^
202 warning: panic message is not a string literal
203 --> $DIR/non-fmt-panic.rs:38:12
205 LL | panic!(format!("{}", 1));
208 = note: this is no longer accepted in Rust 2021
209 = note: the panic!() macro supports formatting, so there's no need for the format!() macro here
210 help: remove the `format!(..)` macro call
212 LL | panic!("{}", 1);
215 warning: panic message is not a string literal
216 --> $DIR/non-fmt-panic.rs:40:12
221 = note: this is no longer accepted in Rust 2021
222 help: add a "{}" format string to Display the message
224 LL | panic!["{}", 123];
226 help: or use std::panic::panic_any instead
228 LL | std::panic::panic_any(123);
229 | ^^^^^^^^^^^^^^^^^^^^^^ ^
231 warning: panic message is not a string literal
232 --> $DIR/non-fmt-panic.rs:41:12
237 = note: this is no longer accepted in Rust 2021
238 help: add a "{}" format string to Display the message
240 LL | panic!{"{}", 123};
242 help: or use std::panic::panic_any instead
244 LL | std::panic::panic_any(123);
245 | ^^^^^^^^^^^^^^^^^^^^^^ ^
247 warning: 18 warnings emitted