]> git.lizzy.rs Git - rust.git/blob - src/test/ui/non-fmt-panic.stderr
Auto merge of #87740 - npmccallum:naked_args, r=Amanieu
[rust.git] / src / test / ui / non-fmt-panic.stderr
1 warning: panic message contains a brace
2   --> $DIR/non-fmt-panic.rs:11: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:12: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:13: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:14: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:16:20
60    |
61 LL |     assert!(false, S);
62    |                    ^
63    |
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>
66 help: add a "{}" format string to Display the message
67    |
68 LL |     assert!(false, "{}", S);
69    |                    ^^^^^
70
71 warning: panic message contains braces
72   --> $DIR/non-fmt-panic.rs:18:27
73    |
74 LL |     debug_assert!(false, "{{}} bla");
75    |                           ^^^^
76    |
77    = note: this message is not used as a format string, but will be in Rust 2021
78 help: add a "{}" format string to use the message literally
79    |
80 LL |     debug_assert!(false, "{}", "{{}} bla");
81    |                          ^^^^^
82
83 warning: panic message is not a string literal
84   --> $DIR/non-fmt-panic.rs:19:12
85    |
86 LL |     panic!(C);
87    |            ^
88    |
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>
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);
98    |     ^^^^^^^^^^^^^^^^^^^^^
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    |
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>
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);
115    |     ^^^^^^^^^^^^^^^^^^^^^
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    |
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>
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);
132    |     ^^^^^^^^^^^^^^^^^^^^^
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    |
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>
142 help: add a "{}" format string to Display the message
143    |
144 LL |     core::panic!("{}", &*"abc");
145    |                  ^^^^^
146
147 warning: panic message contains an unused formatting placeholder
148   --> $DIR/non-fmt-panic.rs:23:12
149    |
150 LL |     panic!(concat!("{", "}"));
151    |            ^^^^^^^^^^^^^^^^^
152    |
153    = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
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
164   --> $DIR/non-fmt-panic.rs:24:5
165    |
166 LL |     panic!(concat!("{", "{"));
167    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
168    |
169    = note: this message is not used as a format string, but will be in Rust 2021
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
176   --> $DIR/non-fmt-panic.rs:26:37
177    |
178 LL |     fancy_panic::fancy_panic!("test {} 123");
179    |                                     ^^
180    |
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    |
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>
191
192 warning: panic message is not a string literal
193   --> $DIR/non-fmt-panic.rs:36:12
194    |
195 LL |     panic!(a!());
196    |            ^^^^
197    |
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>
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    |
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>
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
224   --> $DIR/non-fmt-panic.rs:39:20
225    |
226 LL |     assert!(false, format!("{}", 1));
227    |                    ^^^^^^^^^^^^^^^^
228    |
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>
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    |
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>
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
253    |
254 LL |     panic![123];
255    |            ^^^
256    |
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>
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
269   --> $DIR/non-fmt-panic.rs:43:12
270    |
271 LL |     panic!{123};
272    |            ^^^
273    |
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>
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
285 warning: 20 warnings emitted
286