]> git.lizzy.rs Git - rust.git/blob - src/test/ui/non-fmt-panic.stderr
Pin panic-in-drop=abort test to old pass manager
[rust.git] / src / test / ui / non-fmt-panic.stderr
1 warning: panic message contains a brace
2   --> $DIR/non-fmt-panic.rs:13:29
3    |
4 LL |     panic!("here's a brace: {");
5    |                             ^
6    |
7    = note: `#[warn(non_fmt_panics)]` 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
10    |
11 LL |     panic!("{}", "here's a brace: {");
12    |            +++++
13
14 warning: panic message contains a brace
15   --> $DIR/non-fmt-panic.rs:14:31
16    |
17 LL |     std::panic!("another one: }");
18    |                               ^
19    |
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
22    |
23 LL |     std::panic!("{}", "another one: }");
24    |                 +++++
25
26 warning: panic message contains an unused formatting placeholder
27   --> $DIR/non-fmt-panic.rs:15:25
28    |
29 LL |     core::panic!("Hello {}");
30    |                         ^^
31    |
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
34    |
35 LL |     core::panic!("Hello {}", ...);
36    |                            +++++
37 help: or add a "{}" format string to use the message literally
38    |
39 LL |     core::panic!("{}", "Hello {}");
40    |                  +++++
41
42 warning: panic message contains unused formatting placeholders
43   --> $DIR/non-fmt-panic.rs:16:21
44    |
45 LL |     assert!(false, "{:03x} {test} bla");
46    |                     ^^^^^^ ^^^^^^
47    |
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
50    |
51 LL |     assert!(false, "{:03x} {test} bla", ...);
52    |                                       +++++
53 help: or add a "{}" format string to use the message literally
54    |
55 LL |     assert!(false, "{}", "{:03x} {test} bla");
56    |                    +++++
57
58 warning: panic message is not a string literal
59   --> $DIR/non-fmt-panic.rs:18:20
60    |
61 LL |     assert!(false, S);
62    |                    ^
63    |
64    = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
65    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
66 help: add a "{}" format string to Display the message
67    |
68 LL |     assert!(false, "{}", S);
69    |                    +++++
70
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 assert!() 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 assert!() 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
97 warning: panic message contains braces
98   --> $DIR/non-fmt-panic.rs:24:27
99    |
100 LL |     debug_assert!(false, "{{}} bla");
101    |                           ^^^^
102    |
103    = note: this message is not used as a format string, but will be in Rust 2021
104 help: add a "{}" format string to use the message literally
105    |
106 LL |     debug_assert!(false, "{}", "{{}} bla");
107    |                          +++++
108
109 warning: panic message is not a string literal
110   --> $DIR/non-fmt-panic.rs:25:12
111    |
112 LL |     panic!(C);
113    |            ^
114    |
115    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
116    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
117 help: add a "{}" format string to Display the message
118    |
119 LL |     panic!("{}", C);
120    |            +++++
121
122 warning: panic message is not a string literal
123   --> $DIR/non-fmt-panic.rs:26:12
124    |
125 LL |     panic!(S);
126    |            ^
127    |
128    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
129    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
130 help: add a "{}" format string to Display the message
131    |
132 LL |     panic!("{}", S);
133    |            +++++
134
135 warning: panic message is not a string literal
136   --> $DIR/non-fmt-panic.rs:27:17
137    |
138 LL |     std::panic!(123);
139    |                 ^^^
140    |
141    = note: this usage of std::panic!() is deprecated; it will be a hard error in Rust 2021
142    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
143 help: add a "{}" format string to Display the message
144    |
145 LL |     std::panic!("{}", 123);
146    |                 +++++
147 help: or use std::panic::panic_any instead
148    |
149 LL |     std::panic::panic_any(123);
150    |     ~~~~~~~~~~~~~~~~~~~~~
151
152 warning: panic message is not a string literal
153   --> $DIR/non-fmt-panic.rs:28:18
154    |
155 LL |     core::panic!(&*"abc");
156    |                  ^^^^^^^
157    |
158    = note: this usage of core::panic!() is deprecated; it will be a hard error in Rust 2021
159    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
160 help: add a "{}" format string to Display the message
161    |
162 LL |     core::panic!("{}", &*"abc");
163    |                  +++++
164
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
182 warning: panic message contains an unused formatting placeholder
183   --> $DIR/non-fmt-panic.rs:30:12
184    |
185 LL |     panic!(concat!("{", "}"));
186    |            ^^^^^^^^^^^^^^^^^
187    |
188    = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
189 help: add the missing argument
190    |
191 LL |     panic!(concat!("{", "}"), ...);
192    |                             +++++
193 help: or add a "{}" format string to use the message literally
194    |
195 LL |     panic!("{}", concat!("{", "}"));
196    |            +++++
197
198 warning: panic message contains braces
199   --> $DIR/non-fmt-panic.rs:31:5
200    |
201 LL |     panic!(concat!("{", "{"));
202    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
203    |
204    = note: this message is not used as a format string, but will be in Rust 2021
205 help: add a "{}" format string to use the message literally
206    |
207 LL |     panic!("{}", concat!("{", "{"));
208    |            +++++
209
210 warning: panic message contains an unused formatting placeholder
211   --> $DIR/non-fmt-panic.rs:33:37
212    |
213 LL |     fancy_panic::fancy_panic!("test {} 123");
214    |                                     ^^
215    |
216    = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
217
218 warning: panic message is not a string literal
219   --> $DIR/non-fmt-panic.rs:43:12
220    |
221 LL |     panic!(a!());
222    |            ^^^^
223    |
224    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
225    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
226 help: add a "{}" format string to Display the message
227    |
228 LL |     panic!("{}", a!());
229    |            +++++
230 help: or use std::panic::panic_any instead
231    |
232 LL |     std::panic::panic_any(a!());
233    |     ~~~~~~~~~~~~~~~~~~~~~
234
235 warning: panic message is not a string literal
236   --> $DIR/non-fmt-panic.rs:45:12
237    |
238 LL |     panic!(format!("{}", 1));
239    |            ^^^^^^^^^^^^^^^^
240    |
241    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
242    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
243    = note: the panic!() macro supports formatting, so there's no need for the format!() macro here
244 help: remove the `format!(..)` macro call
245    |
246 LL -     panic!(format!("{}", 1));
247 LL +     panic!("{}", 1);
248    | 
249
250 warning: panic message is not a string literal
251   --> $DIR/non-fmt-panic.rs:46:20
252    |
253 LL |     assert!(false, format!("{}", 1));
254    |                    ^^^^^^^^^^^^^^^^
255    |
256    = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
257    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
258    = note: the assert!() macro supports formatting, so there's no need for the format!() macro here
259 help: remove the `format!(..)` macro call
260    |
261 LL -     assert!(false, format!("{}", 1));
262 LL +     assert!(false, "{}", 1);
263    | 
264
265 warning: panic message is not a string literal
266   --> $DIR/non-fmt-panic.rs:47:26
267    |
268 LL |     debug_assert!(false, format!("{}", 1));
269    |                          ^^^^^^^^^^^^^^^^
270    |
271    = note: this usage of debug_assert!() is deprecated; it will be a hard error in Rust 2021
272    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
273    = note: the debug_assert!() macro supports formatting, so there's no need for the format!() macro here
274 help: remove the `format!(..)` macro call
275    |
276 LL -     debug_assert!(false, format!("{}", 1));
277 LL +     debug_assert!(false, "{}", 1);
278    | 
279
280 warning: panic message is not a string literal
281   --> $DIR/non-fmt-panic.rs:49:12
282    |
283 LL |     panic![123];
284    |            ^^^
285    |
286    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
287    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
288 help: add a "{}" format string to Display the message
289    |
290 LL |     panic!["{}", 123];
291    |            +++++
292 help: or use std::panic::panic_any instead
293    |
294 LL |     std::panic::panic_any(123);
295    |     ~~~~~~~~~~~~~~~~~~~~~~   ~
296
297 warning: panic message is not a string literal
298   --> $DIR/non-fmt-panic.rs:50:12
299    |
300 LL |     panic!{123};
301    |            ^^^
302    |
303    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
304    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
305 help: add a "{}" format string to Display the message
306    |
307 LL |     panic!{"{}", 123};
308    |            +++++
309 help: or use std::panic::panic_any instead
310    |
311 LL |     std::panic::panic_any(123);
312    |     ~~~~~~~~~~~~~~~~~~~~~~   ~
313
314 warning: panic message is not a string literal
315   --> $DIR/non-fmt-panic.rs:67:12
316    |
317 LL |     panic!(v);
318    |     ------ ^
319    |     |
320    |     help: use std::panic::panic_any instead: `std::panic::panic_any`
321    |
322    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
323    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
324
325 warning: panic message is not a string literal
326   --> $DIR/non-fmt-panic.rs:68:20
327    |
328 LL |     assert!(false, v);
329    |                    ^
330    |
331    = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
332    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
333
334 warning: panic message is not a string literal
335   --> $DIR/non-fmt-panic.rs:72:12
336    |
337 LL |     panic!(v);
338    |            ^
339    |
340    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
341    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
342 help: add a "{:?}" format string to use the Debug implementation of `T`
343    |
344 LL |     panic!("{:?}", v);
345    |            +++++++
346 help: or use std::panic::panic_any instead
347    |
348 LL |     std::panic::panic_any(v);
349    |     ~~~~~~~~~~~~~~~~~~~~~
350
351 warning: panic message is not a string literal
352   --> $DIR/non-fmt-panic.rs:73:20
353    |
354 LL |     assert!(false, v);
355    |                    ^
356    |
357    = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
358    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
359 help: add a "{:?}" format string to use the Debug implementation of `T`
360    |
361 LL |     assert!(false, "{:?}", v);
362    |                    +++++++
363
364 warning: panic message is not a string literal
365   --> $DIR/non-fmt-panic.rs:77:12
366    |
367 LL |     panic!(v);
368    |            ^
369    |
370    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
371    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
372 help: add a "{}" format string to Display the message
373    |
374 LL |     panic!("{}", v);
375    |            +++++
376 help: or use std::panic::panic_any instead
377    |
378 LL |     std::panic::panic_any(v);
379    |     ~~~~~~~~~~~~~~~~~~~~~
380
381 warning: panic message is not a string literal
382   --> $DIR/non-fmt-panic.rs:78:20
383    |
384 LL |     assert!(false, v);
385    |                    ^
386    |
387    = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
388    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
389 help: add a "{}" format string to Display the message
390    |
391 LL |     assert!(false, "{}", v);
392    |                    +++++
393
394 warning: panic message is not a string literal
395   --> $DIR/non-fmt-panic.rs:82:12
396    |
397 LL |     panic!(v);
398    |            ^
399    |
400    = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
401    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
402 help: add a "{}" format string to Display the message
403    |
404 LL |     panic!("{}", v);
405    |            +++++
406 help: or use std::panic::panic_any instead
407    |
408 LL |     std::panic::panic_any(v);
409    |     ~~~~~~~~~~~~~~~~~~~~~
410
411 warning: panic message is not a string literal
412   --> $DIR/non-fmt-panic.rs:83:20
413    |
414 LL |     assert!(false, v);
415    |                    ^
416    |
417    = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
418    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
419 help: add a "{}" format string to Display the message
420    |
421 LL |     assert!(false, "{}", v);
422    |                    +++++
423
424 warning: 30 warnings emitted
425