@@ -68,8 +68,34 @@ help: add a "{}" format string to Display the message
68
68
LL | assert!(false, "{}", S);
69
69
| +++++
70
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 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
+
71
97
warning: panic message contains braces
72
- --> $DIR/non-fmt-panic.rs:20 :27
98
+ --> $DIR/non-fmt-panic.rs:24 :27
73
99
|
74
100
LL | debug_assert!(false, "{{}} bla");
75
101
| ^^^^
@@ -81,7 +107,7 @@ LL | debug_assert!(false, "{}", "{{}} bla");
81
107
| +++++
82
108
83
109
warning: panic message is not a string literal
84
- --> $DIR/non-fmt-panic.rs:21 :12
110
+ --> $DIR/non-fmt-panic.rs:25 :12
85
111
|
86
112
LL | panic!(C);
87
113
| ^
@@ -94,7 +120,7 @@ LL | panic!("{}", C);
94
120
| +++++
95
121
96
122
warning: panic message is not a string literal
97
- --> $DIR/non-fmt-panic.rs:22 :12
123
+ --> $DIR/non-fmt-panic.rs:26 :12
98
124
|
99
125
LL | panic!(S);
100
126
| ^
@@ -107,7 +133,7 @@ LL | panic!("{}", S);
107
133
| +++++
108
134
109
135
warning: panic message is not a string literal
110
- --> $DIR/non-fmt-panic.rs:23 :17
136
+ --> $DIR/non-fmt-panic.rs:27 :17
111
137
|
112
138
LL | std::panic!(123);
113
139
| ^^^
@@ -124,7 +150,7 @@ LL | std::panic::panic_any(123);
124
150
| ~~~~~~~~~~~~~~~~~~~~~
125
151
126
152
warning: panic message is not a string literal
127
- --> $DIR/non-fmt-panic.rs:24 :18
153
+ --> $DIR/non-fmt-panic.rs:28 :18
128
154
|
129
155
LL | core::panic!(&*"abc");
130
156
| ^^^^^^^
@@ -136,8 +162,25 @@ help: add a "{}" format string to Display the message
136
162
LL | core::panic!("{}", &*"abc");
137
163
| +++++
138
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
+
139
182
warning: panic message contains an unused formatting placeholder
140
- --> $DIR/non-fmt-panic.rs:25 :12
183
+ --> $DIR/non-fmt-panic.rs:30 :12
141
184
|
142
185
LL | panic!(concat!("{", "}"));
143
186
| ^^^^^^^^^^^^^^^^^
@@ -153,7 +196,7 @@ LL | panic!("{}", concat!("{", "}"));
153
196
| +++++
154
197
155
198
warning: panic message contains braces
156
- --> $DIR/non-fmt-panic.rs:26 :5
199
+ --> $DIR/non-fmt-panic.rs:31 :5
157
200
|
158
201
LL | panic!(concat!("{", "{"));
159
202
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -165,15 +208,15 @@ LL | panic!("{}", concat!("{", "{"));
165
208
| +++++
166
209
167
210
warning: panic message contains an unused formatting placeholder
168
- --> $DIR/non-fmt-panic.rs:28 :37
211
+ --> $DIR/non-fmt-panic.rs:33 :37
169
212
|
170
213
LL | fancy_panic::fancy_panic!("test {} 123");
171
214
| ^^
172
215
|
173
216
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
174
217
175
218
warning: panic message is not a string literal
176
- --> $DIR/non-fmt-panic.rs:38 :12
219
+ --> $DIR/non-fmt-panic.rs:43 :12
177
220
|
178
221
LL | panic!(a!());
179
222
| ^^^^
@@ -190,7 +233,7 @@ LL | std::panic::panic_any(a!());
190
233
| ~~~~~~~~~~~~~~~~~~~~~
191
234
192
235
warning: panic message is not a string literal
193
- --> $DIR/non-fmt-panic.rs:40 :12
236
+ --> $DIR/non-fmt-panic.rs:45 :12
194
237
|
195
238
LL | panic!(format!("{}", 1));
196
239
| ^^^^^^^^^^^^^^^^
@@ -205,7 +248,7 @@ LL + panic!("{}", 1);
205
248
|
206
249
207
250
warning: panic message is not a string literal
208
- --> $DIR/non-fmt-panic.rs:41 :20
251
+ --> $DIR/non-fmt-panic.rs:46 :20
209
252
|
210
253
LL | assert!(false, format!("{}", 1));
211
254
| ^^^^^^^^^^^^^^^^
@@ -220,7 +263,7 @@ LL + assert!(false, "{}", 1);
220
263
|
221
264
222
265
warning: panic message is not a string literal
223
- --> $DIR/non-fmt-panic.rs:42 :26
266
+ --> $DIR/non-fmt-panic.rs:47 :26
224
267
|
225
268
LL | debug_assert!(false, format!("{}", 1));
226
269
| ^^^^^^^^^^^^^^^^
@@ -235,7 +278,7 @@ LL + debug_assert!(false, "{}", 1);
235
278
|
236
279
237
280
warning: panic message is not a string literal
238
- --> $DIR/non-fmt-panic.rs:44 :12
281
+ --> $DIR/non-fmt-panic.rs:49 :12
239
282
|
240
283
LL | panic![123];
241
284
| ^^^
@@ -252,7 +295,7 @@ LL | std::panic::panic_any(123);
252
295
| ~~~~~~~~~~~~~~~~~~~~~~ ~
253
296
254
297
warning: panic message is not a string literal
255
- --> $DIR/non-fmt-panic.rs:45 :12
298
+ --> $DIR/non-fmt-panic.rs:50 :12
256
299
|
257
300
LL | panic!{123};
258
301
| ^^^
@@ -268,5 +311,5 @@ help: or use std::panic::panic_any instead
268
311
LL | std::panic::panic_any(123);
269
312
| ~~~~~~~~~~~~~~~~~~~~~~ ~
270
313
271
- warning: 19 warnings emitted
314
+ warning: 22 warnings emitted
272
315
0 commit comments