@@ -12,7 +12,19 @@ LL | panic!("{}", "here's a brace: {");
12
12
| +++++
13
13
14
14
warning: panic message contains a brace
15
- --> $DIR/non-fmt-panic.rs:14:31
15
+ --> $DIR/non-fmt-panic.rs:14:35
16
+ |
17
+ LL | unreachable!("here's a brace: {");
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 | unreachable!("{}", "here's a brace: {");
24
+ | +++++
25
+
26
+ warning: panic message contains a brace
27
+ --> $DIR/non-fmt-panic.rs:15:31
16
28
|
17
29
LL | std::panic!("another one: }");
18
30
| ^
@@ -24,7 +36,7 @@ LL | std::panic!("{}", "another one: }");
24
36
| +++++
25
37
26
38
warning: panic message contains an unused formatting placeholder
27
- --> $DIR/non-fmt-panic.rs:15 :25
39
+ --> $DIR/non-fmt-panic.rs:16 :25
28
40
|
29
41
LL | core::panic!("Hello {}");
30
42
| ^^
@@ -40,7 +52,7 @@ LL | core::panic!("{}", "Hello {}");
40
52
| +++++
41
53
42
54
warning: panic message contains unused formatting placeholders
43
- --> $DIR/non-fmt-panic.rs:16 :21
55
+ --> $DIR/non-fmt-panic.rs:17 :21
44
56
|
45
57
LL | assert!(false, "{:03x} {test} bla");
46
58
| ^^^^^^ ^^^^^^
@@ -56,7 +68,7 @@ LL | assert!(false, "{}", "{:03x} {test} bla");
56
68
| +++++
57
69
58
70
warning: panic message is not a string literal
59
- --> $DIR/non-fmt-panic.rs:18 :20
71
+ --> $DIR/non-fmt-panic.rs:19 :20
60
72
|
61
73
LL | assert!(false, S);
62
74
| ^
@@ -69,7 +81,7 @@ LL | assert!(false, "{}", S);
69
81
| +++++
70
82
71
83
warning: panic message is not a string literal
72
- --> $DIR/non-fmt-panic.rs:20 :20
84
+ --> $DIR/non-fmt-panic.rs:21 :20
73
85
|
74
86
LL | assert!(false, 123);
75
87
| ^^^
@@ -82,7 +94,7 @@ LL | assert!(false, "{}", 123);
82
94
| +++++
83
95
84
96
warning: panic message is not a string literal
85
- --> $DIR/non-fmt-panic.rs:22 :20
97
+ --> $DIR/non-fmt-panic.rs:23 :20
86
98
|
87
99
LL | assert!(false, Some(123));
88
100
| ^^^^^^^^^
@@ -95,7 +107,7 @@ LL | assert!(false, "{:?}", Some(123));
95
107
| +++++++
96
108
97
109
warning: panic message contains braces
98
- --> $DIR/non-fmt-panic.rs:24 :27
110
+ --> $DIR/non-fmt-panic.rs:25 :27
99
111
|
100
112
LL | debug_assert!(false, "{{}} bla");
101
113
| ^^^^
@@ -107,7 +119,7 @@ LL | debug_assert!(false, "{}", "{{}} bla");
107
119
| +++++
108
120
109
121
warning: panic message is not a string literal
110
- --> $DIR/non-fmt-panic.rs:25 :12
122
+ --> $DIR/non-fmt-panic.rs:26 :12
111
123
|
112
124
LL | panic!(C);
113
125
| ^
@@ -120,7 +132,7 @@ LL | panic!("{}", C);
120
132
| +++++
121
133
122
134
warning: panic message is not a string literal
123
- --> $DIR/non-fmt-panic.rs:26 :12
135
+ --> $DIR/non-fmt-panic.rs:27 :12
124
136
|
125
137
LL | panic!(S);
126
138
| ^
@@ -133,7 +145,33 @@ LL | panic!("{}", S);
133
145
| +++++
134
146
135
147
warning: panic message is not a string literal
136
- --> $DIR/non-fmt-panic.rs:27:17
148
+ --> $DIR/non-fmt-panic.rs:28:18
149
+ |
150
+ LL | unreachable!(S);
151
+ | ^
152
+ |
153
+ = note: this usage of unreachable!() is deprecated; it will be a hard error in Rust 2021
154
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
155
+ help: add a "{}" format string to Display the message
156
+ |
157
+ LL | unreachable!("{}", S);
158
+ | +++++
159
+
160
+ warning: panic message is not a string literal
161
+ --> $DIR/non-fmt-panic.rs:29:18
162
+ |
163
+ LL | unreachable!(S);
164
+ | ^
165
+ |
166
+ = note: this usage of unreachable!() is deprecated; it will be a hard error in Rust 2021
167
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
168
+ help: add a "{}" format string to Display the message
169
+ |
170
+ LL | unreachable!("{}", S);
171
+ | +++++
172
+
173
+ warning: panic message is not a string literal
174
+ --> $DIR/non-fmt-panic.rs:30:17
137
175
|
138
176
LL | std::panic!(123);
139
177
| ^^^
@@ -150,7 +188,7 @@ LL | std::panic::panic_any(123);
150
188
| ~~~~~~~~~~~~~~~~~~~~~
151
189
152
190
warning: panic message is not a string literal
153
- --> $DIR/non-fmt-panic.rs:28 :18
191
+ --> $DIR/non-fmt-panic.rs:31 :18
154
192
|
155
193
LL | core::panic!(&*"abc");
156
194
| ^^^^^^^
@@ -163,7 +201,7 @@ LL | core::panic!("{}", &*"abc");
163
201
| +++++
164
202
165
203
warning: panic message is not a string literal
166
- --> $DIR/non-fmt-panic.rs:29 :12
204
+ --> $DIR/non-fmt-panic.rs:32 :12
167
205
|
168
206
LL | panic!(Some(123));
169
207
| ^^^^^^^^^
@@ -180,7 +218,7 @@ LL | std::panic::panic_any(Some(123));
180
218
| ~~~~~~~~~~~~~~~~~~~~~
181
219
182
220
warning: panic message contains an unused formatting placeholder
183
- --> $DIR/non-fmt-panic.rs:30 :12
221
+ --> $DIR/non-fmt-panic.rs:33 :12
184
222
|
185
223
LL | panic!(concat!("{", "}"));
186
224
| ^^^^^^^^^^^^^^^^^
@@ -196,7 +234,7 @@ LL | panic!("{}", concat!("{", "}"));
196
234
| +++++
197
235
198
236
warning: panic message contains braces
199
- --> $DIR/non-fmt-panic.rs:31 :5
237
+ --> $DIR/non-fmt-panic.rs:34 :5
200
238
|
201
239
LL | panic!(concat!("{", "{"));
202
240
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -208,15 +246,15 @@ LL | panic!("{}", concat!("{", "{"));
208
246
| +++++
209
247
210
248
warning: panic message contains an unused formatting placeholder
211
- --> $DIR/non-fmt-panic.rs:33 :37
249
+ --> $DIR/non-fmt-panic.rs:36 :37
212
250
|
213
251
LL | fancy_panic::fancy_panic!("test {} 123");
214
252
| ^^
215
253
|
216
254
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
217
255
218
256
warning: panic message is not a string literal
219
- --> $DIR/non-fmt-panic.rs:43 :12
257
+ --> $DIR/non-fmt-panic.rs:46 :12
220
258
|
221
259
LL | panic!(a!());
222
260
| ^^^^
@@ -233,7 +271,20 @@ LL | std::panic::panic_any(a!());
233
271
| ~~~~~~~~~~~~~~~~~~~~~
234
272
235
273
warning: panic message is not a string literal
236
- --> $DIR/non-fmt-panic.rs:45:12
274
+ --> $DIR/non-fmt-panic.rs:47:18
275
+ |
276
+ LL | unreachable!(a!());
277
+ | ^^^^
278
+ |
279
+ = note: this usage of unreachable!() is deprecated; it will be a hard error in Rust 2021
280
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
281
+ help: add a "{}" format string to Display the message
282
+ |
283
+ LL | unreachable!("{}", a!());
284
+ | +++++
285
+
286
+ warning: panic message is not a string literal
287
+ --> $DIR/non-fmt-panic.rs:49:12
237
288
|
238
289
LL | panic!(format!("{}", 1));
239
290
| ^^^^^^^^^^^^^^^^
@@ -248,7 +299,22 @@ LL + panic!("{}", 1);
248
299
|
249
300
250
301
warning: panic message is not a string literal
251
- --> $DIR/non-fmt-panic.rs:46:20
302
+ --> $DIR/non-fmt-panic.rs:50:18
303
+ |
304
+ LL | unreachable!(format!("{}", 1));
305
+ | ^^^^^^^^^^^^^^^^
306
+ |
307
+ = note: this usage of unreachable!() is deprecated; it will be a hard error in Rust 2021
308
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
309
+ = note: the unreachable!() macro supports formatting, so there's no need for the format!() macro here
310
+ help: remove the `format!(..)` macro call
311
+ |
312
+ LL - unreachable!(format!("{}", 1));
313
+ LL + unreachable!("{}", 1);
314
+ |
315
+
316
+ warning: panic message is not a string literal
317
+ --> $DIR/non-fmt-panic.rs:51:20
252
318
|
253
319
LL | assert!(false, format!("{}", 1));
254
320
| ^^^^^^^^^^^^^^^^
@@ -263,7 +329,7 @@ LL + assert!(false, "{}", 1);
263
329
|
264
330
265
331
warning: panic message is not a string literal
266
- --> $DIR/non-fmt-panic.rs:47 :26
332
+ --> $DIR/non-fmt-panic.rs:52 :26
267
333
|
268
334
LL | debug_assert!(false, format!("{}", 1));
269
335
| ^^^^^^^^^^^^^^^^
@@ -278,7 +344,7 @@ LL + debug_assert!(false, "{}", 1);
278
344
|
279
345
280
346
warning: panic message is not a string literal
281
- --> $DIR/non-fmt-panic.rs:49 :12
347
+ --> $DIR/non-fmt-panic.rs:54 :12
282
348
|
283
349
LL | panic![123];
284
350
| ^^^
@@ -295,7 +361,7 @@ LL | std::panic::panic_any(123);
295
361
| ~~~~~~~~~~~~~~~~~~~~~~ ~
296
362
297
363
warning: panic message is not a string literal
298
- --> $DIR/non-fmt-panic.rs:50 :12
364
+ --> $DIR/non-fmt-panic.rs:55 :12
299
365
|
300
366
LL | panic!{123};
301
367
| ^^^
@@ -312,7 +378,7 @@ LL | std::panic::panic_any(123);
312
378
| ~~~~~~~~~~~~~~~~~~~~~~ ~
313
379
314
380
warning: panic message is not a string literal
315
- --> $DIR/non-fmt-panic.rs:67 :12
381
+ --> $DIR/non-fmt-panic.rs:72 :12
316
382
|
317
383
LL | panic!(v);
318
384
| ------ ^
@@ -323,7 +389,7 @@ LL | panic!(v);
323
389
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
324
390
325
391
warning: panic message is not a string literal
326
- --> $DIR/non-fmt-panic.rs:68 :20
392
+ --> $DIR/non-fmt-panic.rs:73 :20
327
393
|
328
394
LL | assert!(false, v);
329
395
| ^
@@ -332,7 +398,7 @@ LL | assert!(false, v);
332
398
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
333
399
334
400
warning: panic message is not a string literal
335
- --> $DIR/non-fmt-panic.rs:72 :12
401
+ --> $DIR/non-fmt-panic.rs:77 :12
336
402
|
337
403
LL | panic!(v);
338
404
| ^
@@ -349,7 +415,7 @@ LL | std::panic::panic_any(v);
349
415
| ~~~~~~~~~~~~~~~~~~~~~
350
416
351
417
warning: panic message is not a string literal
352
- --> $DIR/non-fmt-panic.rs:73 :20
418
+ --> $DIR/non-fmt-panic.rs:78 :20
353
419
|
354
420
LL | assert!(false, v);
355
421
| ^
@@ -362,7 +428,7 @@ LL | assert!(false, "{:?}", v);
362
428
| +++++++
363
429
364
430
warning: panic message is not a string literal
365
- --> $DIR/non-fmt-panic.rs:77 :12
431
+ --> $DIR/non-fmt-panic.rs:82 :12
366
432
|
367
433
LL | panic!(v);
368
434
| ^
@@ -379,7 +445,7 @@ LL | std::panic::panic_any(v);
379
445
| ~~~~~~~~~~~~~~~~~~~~~
380
446
381
447
warning: panic message is not a string literal
382
- --> $DIR/non-fmt-panic.rs:78 :20
448
+ --> $DIR/non-fmt-panic.rs:83 :20
383
449
|
384
450
LL | assert!(false, v);
385
451
| ^
@@ -392,7 +458,7 @@ LL | assert!(false, "{}", v);
392
458
| +++++
393
459
394
460
warning: panic message is not a string literal
395
- --> $DIR/non-fmt-panic.rs:82 :12
461
+ --> $DIR/non-fmt-panic.rs:87 :12
396
462
|
397
463
LL | panic!(v);
398
464
| ^
@@ -409,7 +475,7 @@ LL | std::panic::panic_any(v);
409
475
| ~~~~~~~~~~~~~~~~~~~~~
410
476
411
477
warning: panic message is not a string literal
412
- --> $DIR/non-fmt-panic.rs:83 :20
478
+ --> $DIR/non-fmt-panic.rs:88 :20
413
479
|
414
480
LL | assert!(false, v);
415
481
| ^
@@ -421,5 +487,5 @@ help: add a "{}" format string to Display the message
421
487
LL | assert!(false, "{}", v);
422
488
| +++++
423
489
424
- warning: 30 warnings emitted
490
+ warning: 35 warnings emitted
425
491
0 commit comments