]>
Commit | Line | Data |
---|---|---|
fc512014 | 1 | warning: panic message contains a brace |
5869c6ff | 2 | --> $DIR/non-fmt-panic.rs:11:29 |
fc512014 XL |
3 | | |
4 | LL | panic!("here's a brace: {"); | |
5 | | ^ | |
6 | | | |
136023e0 | 7 | = note: `#[warn(non_fmt_panics)]` on by default |
5869c6ff | 8 | = note: this message is not used as a format string, but will be in Rust 2021 |
fc512014 XL |
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 | |
5869c6ff | 15 | --> $DIR/non-fmt-panic.rs:12:31 |
fc512014 XL |
16 | | |
17 | LL | std::panic!("another one: }"); | |
18 | | ^ | |
19 | | | |
5869c6ff | 20 | = note: this message is not used as a format string, but will be in Rust 2021 |
fc512014 XL |
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 | |
5869c6ff | 27 | --> $DIR/non-fmt-panic.rs:13:25 |
fc512014 XL |
28 | | |
29 | LL | core::panic!("Hello {}"); | |
30 | | ^^ | |
31 | | | |
5869c6ff | 32 | = note: this message is not used as a format string when given without arguments, but will be in Rust 2021 |
fc512014 XL |
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 | |
5869c6ff | 43 | --> $DIR/non-fmt-panic.rs:14:21 |
fc512014 XL |
44 | | |
45 | LL | assert!(false, "{:03x} {test} bla"); | |
46 | | ^^^^^^ ^^^^^^ | |
47 | | | |
5869c6ff | 48 | = note: this message is not used as a format string when given without arguments, but will be in Rust 2021 |
fc512014 XL |
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 | ||
5869c6ff XL |
58 | warning: panic message is not a string literal |
59 | --> $DIR/non-fmt-panic.rs:16:20 | |
60 | | | |
61 | LL | assert!(false, S); | |
62 | | ^ | |
63 | | | |
136023e0 XL |
64 | = note: this usage of panic!() 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> | |
5869c6ff XL |
66 | help: add a "{}" format string to Display the message |
67 | | | |
68 | LL | assert!(false, "{}", S); | |
69 | | ^^^^^ | |
70 | ||
fc512014 | 71 | warning: panic message contains braces |
5869c6ff | 72 | --> $DIR/non-fmt-panic.rs:18:27 |
fc512014 XL |
73 | | |
74 | LL | debug_assert!(false, "{{}} bla"); | |
75 | | ^^^^ | |
76 | | | |
5869c6ff | 77 | = note: this message is not used as a format string, but will be in Rust 2021 |
fc512014 XL |
78 | help: add a "{}" format string to use the message literally |
79 | | | |
80 | LL | debug_assert!(false, "{}", "{{}} bla"); | |
81 | | ^^^^^ | |
82 | ||
5869c6ff XL |
83 | warning: panic message is not a string literal |
84 | --> $DIR/non-fmt-panic.rs:19:12 | |
85 | | | |
86 | LL | panic!(C); | |
87 | | ^ | |
88 | | | |
136023e0 XL |
89 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
90 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
5869c6ff XL |
91 | help: add a "{}" format string to Display the message |
92 | | | |
93 | LL | panic!("{}", C); | |
94 | | ^^^^^ | |
95 | help: or use std::panic::panic_any instead | |
96 | | | |
97 | LL | std::panic::panic_any(C); | |
6a06907d | 98 | | ^^^^^^^^^^^^^^^^^^^^^ |
5869c6ff XL |
99 | |
100 | warning: panic message is not a string literal | |
101 | --> $DIR/non-fmt-panic.rs:20:12 | |
102 | | | |
103 | LL | panic!(S); | |
104 | | ^ | |
105 | | | |
136023e0 XL |
106 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
107 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
5869c6ff XL |
108 | help: add a "{}" format string to Display the message |
109 | | | |
110 | LL | panic!("{}", S); | |
111 | | ^^^^^ | |
112 | help: or use std::panic::panic_any instead | |
113 | | | |
114 | LL | std::panic::panic_any(S); | |
6a06907d | 115 | | ^^^^^^^^^^^^^^^^^^^^^ |
5869c6ff XL |
116 | |
117 | warning: panic message is not a string literal | |
118 | --> $DIR/non-fmt-panic.rs:21:17 | |
119 | | | |
120 | LL | std::panic!(123); | |
121 | | ^^^ | |
122 | | | |
136023e0 XL |
123 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
124 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
5869c6ff XL |
125 | help: add a "{}" format string to Display the message |
126 | | | |
127 | LL | std::panic!("{}", 123); | |
128 | | ^^^^^ | |
129 | help: or use std::panic::panic_any instead | |
130 | | | |
131 | LL | std::panic::panic_any(123); | |
6a06907d | 132 | | ^^^^^^^^^^^^^^^^^^^^^ |
5869c6ff XL |
133 | |
134 | warning: panic message is not a string literal | |
135 | --> $DIR/non-fmt-panic.rs:22:18 | |
136 | | | |
137 | LL | core::panic!(&*"abc"); | |
138 | | ^^^^^^^ | |
139 | | | |
136023e0 XL |
140 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
141 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
5869c6ff XL |
142 | help: add a "{}" format string to Display the message |
143 | | | |
144 | LL | core::panic!("{}", &*"abc"); | |
145 | | ^^^^^ | |
146 | ||
fc512014 | 147 | warning: panic message contains an unused formatting placeholder |
5869c6ff | 148 | --> $DIR/non-fmt-panic.rs:23:12 |
fc512014 XL |
149 | | |
150 | LL | panic!(concat!("{", "}")); | |
151 | | ^^^^^^^^^^^^^^^^^ | |
152 | | | |
5869c6ff | 153 | = note: this message is not used as a format string when given without arguments, but will be in Rust 2021 |
fc512014 XL |
154 | help: add the missing argument |
155 | | | |
156 | LL | panic!(concat!("{", "}"), ...); | |
157 | | ^^^^^ | |
158 | help: or add a "{}" format string to use the message literally | |
159 | | | |
160 | LL | panic!("{}", concat!("{", "}")); | |
161 | | ^^^^^ | |
162 | ||
163 | warning: panic message contains braces | |
5869c6ff | 164 | --> $DIR/non-fmt-panic.rs:24:5 |
fc512014 XL |
165 | | |
166 | LL | panic!(concat!("{", "{")); | |
167 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
168 | | | |
5869c6ff | 169 | = note: this message is not used as a format string, but will be in Rust 2021 |
fc512014 XL |
170 | help: add a "{}" format string to use the message literally |
171 | | | |
172 | LL | panic!("{}", concat!("{", "{")); | |
173 | | ^^^^^ | |
174 | ||
175 | warning: panic message contains an unused formatting placeholder | |
5869c6ff | 176 | --> $DIR/non-fmt-panic.rs:26:37 |
fc512014 XL |
177 | | |
178 | LL | fancy_panic::fancy_panic!("test {} 123"); | |
179 | | ^^ | |
180 | | | |
5869c6ff XL |
181 | = note: this message is not used as a format string when given without arguments, but will be in Rust 2021 |
182 | ||
183 | warning: panic message is not a string literal | |
184 | --> $DIR/non-fmt-panic.rs:29:31 | |
185 | | | |
186 | LL | fancy_panic::fancy_panic!(S); | |
187 | | ^ | |
188 | | | |
136023e0 XL |
189 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
190 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
fc512014 | 191 | |
6a06907d XL |
192 | warning: panic message is not a string literal |
193 | --> $DIR/non-fmt-panic.rs:36:12 | |
194 | | | |
195 | LL | panic!(a!()); | |
196 | | ^^^^ | |
197 | | | |
136023e0 XL |
198 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
199 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
6a06907d XL |
200 | help: add a "{}" format string to Display the message |
201 | | | |
202 | LL | panic!("{}", a!()); | |
203 | | ^^^^^ | |
204 | help: or use std::panic::panic_any instead | |
205 | | | |
206 | LL | std::panic::panic_any(a!()); | |
207 | | ^^^^^^^^^^^^^^^^^^^^^ | |
208 | ||
209 | warning: panic message is not a string literal | |
210 | --> $DIR/non-fmt-panic.rs:38:12 | |
211 | | | |
212 | LL | panic!(format!("{}", 1)); | |
213 | | ^^^^^^^^^^^^^^^^ | |
214 | | | |
136023e0 XL |
215 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
216 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
6a06907d XL |
217 | = note: the panic!() macro supports formatting, so there's no need for the format!() macro here |
218 | help: remove the `format!(..)` macro call | |
219 | | | |
220 | LL | panic!("{}", 1); | |
221 | | -- -- | |
222 | ||
223 | warning: panic message is not a string literal | |
17df50a5 XL |
224 | --> $DIR/non-fmt-panic.rs:39:20 |
225 | | | |
226 | LL | assert!(false, format!("{}", 1)); | |
227 | | ^^^^^^^^^^^^^^^^ | |
228 | | | |
136023e0 XL |
229 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
230 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
17df50a5 XL |
231 | = note: the assert!() macro supports formatting, so there's no need for the format!() macro here |
232 | help: remove the `format!(..)` macro call | |
233 | | | |
234 | LL | assert!(false, "{}", 1); | |
235 | | -- -- | |
236 | ||
237 | warning: panic message is not a string literal | |
238 | --> $DIR/non-fmt-panic.rs:40:26 | |
239 | | | |
240 | LL | debug_assert!(false, format!("{}", 1)); | |
241 | | ^^^^^^^^^^^^^^^^ | |
242 | | | |
136023e0 XL |
243 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
244 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
17df50a5 XL |
245 | = note: the debug_assert!() macro supports formatting, so there's no need for the format!() macro here |
246 | help: remove the `format!(..)` macro call | |
247 | | | |
248 | LL | debug_assert!(false, "{}", 1); | |
249 | | -- -- | |
250 | ||
251 | warning: panic message is not a string literal | |
252 | --> $DIR/non-fmt-panic.rs:42:12 | |
6a06907d XL |
253 | | |
254 | LL | panic![123]; | |
255 | | ^^^ | |
256 | | | |
136023e0 XL |
257 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
258 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
6a06907d XL |
259 | help: add a "{}" format string to Display the message |
260 | | | |
261 | LL | panic!["{}", 123]; | |
262 | | ^^^^^ | |
263 | help: or use std::panic::panic_any instead | |
264 | | | |
265 | LL | std::panic::panic_any(123); | |
266 | | ^^^^^^^^^^^^^^^^^^^^^^ ^ | |
267 | ||
268 | warning: panic message is not a string literal | |
17df50a5 | 269 | --> $DIR/non-fmt-panic.rs:43:12 |
6a06907d XL |
270 | | |
271 | LL | panic!{123}; | |
272 | | ^^^ | |
273 | | | |
136023e0 XL |
274 | = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021 |
275 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html> | |
6a06907d XL |
276 | help: add a "{}" format string to Display the message |
277 | | | |
278 | LL | panic!{"{}", 123}; | |
279 | | ^^^^^ | |
280 | help: or use std::panic::panic_any instead | |
281 | | | |
282 | LL | std::panic::panic_any(123); | |
283 | | ^^^^^^^^^^^^^^^^^^^^^^ ^ | |
284 | ||
17df50a5 | 285 | warning: 20 warnings emitted |
fc512014 | 286 |