@@ -68,8 +68,34 @@ help: add a "{}" format string to Display the message
6868LL | assert!(false, "{}", S);
6969 | +++++
7070
71+ warning: panic message is not a string literal
72+ --> $DIR/non-fmt-panic.rs:20:20
73+ |
74+ LL | assert!(false, 123);
75+ | ^^^
76+ |
77+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
78+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
79+ help: add a "{}" format string to Display the message
80+ |
81+ LL | assert!(false, "{}", 123);
82+ | +++++
83+
84+ warning: panic message is not a string literal
85+ --> $DIR/non-fmt-panic.rs:22:20
86+ |
87+ LL | assert!(false, Some(123));
88+ | ^^^^^^^^^
89+ |
90+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
91+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
92+ help: add a "{:?}" format string to use the Debug implementation of `Option<i32>`
93+ |
94+ LL | assert!(false, "{:?}", Some(123));
95+ | +++++++
96+
7197warning: panic message contains braces
72- --> $DIR/non-fmt-panic.rs:20 :27
98+ --> $DIR/non-fmt-panic.rs:24 :27
7399 |
74100LL | debug_assert!(false, "{{}} bla");
75101 | ^^^^
@@ -81,7 +107,7 @@ LL | debug_assert!(false, "{}", "{{}} bla");
81107 | +++++
82108
83109warning: panic message is not a string literal
84- --> $DIR/non-fmt-panic.rs:21 :12
110+ --> $DIR/non-fmt-panic.rs:25 :12
85111 |
86112LL | panic!(C);
87113 | ^
@@ -94,7 +120,7 @@ LL | panic!("{}", C);
94120 | +++++
95121
96122warning: panic message is not a string literal
97- --> $DIR/non-fmt-panic.rs:22 :12
123+ --> $DIR/non-fmt-panic.rs:26 :12
98124 |
99125LL | panic!(S);
100126 | ^
@@ -107,7 +133,7 @@ LL | panic!("{}", S);
107133 | +++++
108134
109135warning: panic message is not a string literal
110- --> $DIR/non-fmt-panic.rs:23 :17
136+ --> $DIR/non-fmt-panic.rs:27 :17
111137 |
112138LL | std::panic!(123);
113139 | ^^^
@@ -124,7 +150,7 @@ LL | std::panic::panic_any(123);
124150 | ~~~~~~~~~~~~~~~~~~~~~
125151
126152warning: panic message is not a string literal
127- --> $DIR/non-fmt-panic.rs:24 :18
153+ --> $DIR/non-fmt-panic.rs:28 :18
128154 |
129155LL | core::panic!(&*"abc");
130156 | ^^^^^^^
@@ -136,8 +162,25 @@ help: add a "{}" format string to Display the message
136162LL | core::panic!("{}", &*"abc");
137163 | +++++
138164
165+ warning: panic message is not a string literal
166+ --> $DIR/non-fmt-panic.rs:29:12
167+ |
168+ LL | panic!(Some(123));
169+ | ^^^^^^^^^
170+ |
171+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
172+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
173+ help: add a "{:?}" format string to use the Debug implementation of `Option<i32>`
174+ |
175+ LL | panic!("{:?}", Some(123));
176+ | +++++++
177+ help: or use std::panic::panic_any instead
178+ |
179+ LL | std::panic::panic_any(Some(123));
180+ | ~~~~~~~~~~~~~~~~~~~~~
181+
139182warning: panic message contains an unused formatting placeholder
140- --> $DIR/non-fmt-panic.rs:25 :12
183+ --> $DIR/non-fmt-panic.rs:30 :12
141184 |
142185LL | panic!(concat!("{", "}"));
143186 | ^^^^^^^^^^^^^^^^^
@@ -153,7 +196,7 @@ LL | panic!("{}", concat!("{", "}"));
153196 | +++++
154197
155198warning: panic message contains braces
156- --> $DIR/non-fmt-panic.rs:26 :5
199+ --> $DIR/non-fmt-panic.rs:31 :5
157200 |
158201LL | panic!(concat!("{", "{"));
159202 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -165,15 +208,15 @@ LL | panic!("{}", concat!("{", "{"));
165208 | +++++
166209
167210warning: panic message contains an unused formatting placeholder
168- --> $DIR/non-fmt-panic.rs:28 :37
211+ --> $DIR/non-fmt-panic.rs:33 :37
169212 |
170213LL | fancy_panic::fancy_panic!("test {} 123");
171214 | ^^
172215 |
173216 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
174217
175218warning: panic message is not a string literal
176- --> $DIR/non-fmt-panic.rs:38 :12
219+ --> $DIR/non-fmt-panic.rs:43 :12
177220 |
178221LL | panic!(a!());
179222 | ^^^^
@@ -190,7 +233,7 @@ LL | std::panic::panic_any(a!());
190233 | ~~~~~~~~~~~~~~~~~~~~~
191234
192235warning: panic message is not a string literal
193- --> $DIR/non-fmt-panic.rs:40 :12
236+ --> $DIR/non-fmt-panic.rs:45 :12
194237 |
195238LL | panic!(format!("{}", 1));
196239 | ^^^^^^^^^^^^^^^^
@@ -205,7 +248,7 @@ LL + panic!("{}", 1);
205248 |
206249
207250warning: panic message is not a string literal
208- --> $DIR/non-fmt-panic.rs:41 :20
251+ --> $DIR/non-fmt-panic.rs:46 :20
209252 |
210253LL | assert!(false, format!("{}", 1));
211254 | ^^^^^^^^^^^^^^^^
@@ -220,7 +263,7 @@ LL + assert!(false, "{}", 1);
220263 |
221264
222265warning: panic message is not a string literal
223- --> $DIR/non-fmt-panic.rs:42 :26
266+ --> $DIR/non-fmt-panic.rs:47 :26
224267 |
225268LL | debug_assert!(false, format!("{}", 1));
226269 | ^^^^^^^^^^^^^^^^
@@ -235,7 +278,7 @@ LL + debug_assert!(false, "{}", 1);
235278 |
236279
237280warning: panic message is not a string literal
238- --> $DIR/non-fmt-panic.rs:44 :12
281+ --> $DIR/non-fmt-panic.rs:49 :12
239282 |
240283LL | panic![123];
241284 | ^^^
@@ -252,7 +295,7 @@ LL | std::panic::panic_any(123);
252295 | ~~~~~~~~~~~~~~~~~~~~~~ ~
253296
254297warning: panic message is not a string literal
255- --> $DIR/non-fmt-panic.rs:45 :12
298+ --> $DIR/non-fmt-panic.rs:50 :12
256299 |
257300LL | panic!{123};
258301 | ^^^
@@ -268,5 +311,5 @@ help: or use std::panic::panic_any instead
268311LL | std::panic::panic_any(123);
269312 | ~~~~~~~~~~~~~~~~~~~~~~ ~
270313
271- warning: 19 warnings emitted
314+ warning: 22 warnings emitted
272315
0 commit comments