]> git.proxmox.com Git - rustc.git/blame - src/test/ui/non-fmt-panic.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / non-fmt-panic.stderr
CommitLineData
fc512014 1warning: panic message contains a brace
5869c6ff 2 --> $DIR/non-fmt-panic.rs:11:29
fc512014
XL
3 |
4LL | 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
9help: add a "{}" format string to use the message literally
10 |
11LL | panic!("{}", "here's a brace: {");
12 | ^^^^^
13
14warning: panic message contains a brace
5869c6ff 15 --> $DIR/non-fmt-panic.rs:12:31
fc512014
XL
16 |
17LL | 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
21help: add a "{}" format string to use the message literally
22 |
23LL | std::panic!("{}", "another one: }");
24 | ^^^^^
25
26warning: panic message contains an unused formatting placeholder
5869c6ff 27 --> $DIR/non-fmt-panic.rs:13:25
fc512014
XL
28 |
29LL | 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
33help: add the missing argument
34 |
35LL | core::panic!("Hello {}", ...);
36 | ^^^^^
37help: or add a "{}" format string to use the message literally
38 |
39LL | core::panic!("{}", "Hello {}");
40 | ^^^^^
41
42warning: panic message contains unused formatting placeholders
5869c6ff 43 --> $DIR/non-fmt-panic.rs:14:21
fc512014
XL
44 |
45LL | 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
49help: add the missing arguments
50 |
51LL | assert!(false, "{:03x} {test} bla", ...);
52 | ^^^^^
53help: or add a "{}" format string to use the message literally
54 |
55LL | assert!(false, "{}", "{:03x} {test} bla");
56 | ^^^^^
57
5869c6ff
XL
58warning: panic message is not a string literal
59 --> $DIR/non-fmt-panic.rs:16:20
60 |
61LL | 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
66help: add a "{}" format string to Display the message
67 |
68LL | assert!(false, "{}", S);
69 | ^^^^^
70
fc512014 71warning: panic message contains braces
5869c6ff 72 --> $DIR/non-fmt-panic.rs:18:27
fc512014
XL
73 |
74LL | 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
78help: add a "{}" format string to use the message literally
79 |
80LL | debug_assert!(false, "{}", "{{}} bla");
81 | ^^^^^
82
5869c6ff
XL
83warning: panic message is not a string literal
84 --> $DIR/non-fmt-panic.rs:19:12
85 |
86LL | 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
91help: add a "{}" format string to Display the message
92 |
93LL | panic!("{}", C);
94 | ^^^^^
95help: or use std::panic::panic_any instead
96 |
97LL | std::panic::panic_any(C);
6a06907d 98 | ^^^^^^^^^^^^^^^^^^^^^
5869c6ff
XL
99
100warning: panic message is not a string literal
101 --> $DIR/non-fmt-panic.rs:20:12
102 |
103LL | 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
108help: add a "{}" format string to Display the message
109 |
110LL | panic!("{}", S);
111 | ^^^^^
112help: or use std::panic::panic_any instead
113 |
114LL | std::panic::panic_any(S);
6a06907d 115 | ^^^^^^^^^^^^^^^^^^^^^
5869c6ff
XL
116
117warning: panic message is not a string literal
118 --> $DIR/non-fmt-panic.rs:21:17
119 |
120LL | 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
125help: add a "{}" format string to Display the message
126 |
127LL | std::panic!("{}", 123);
128 | ^^^^^
129help: or use std::panic::panic_any instead
130 |
131LL | std::panic::panic_any(123);
6a06907d 132 | ^^^^^^^^^^^^^^^^^^^^^
5869c6ff
XL
133
134warning: panic message is not a string literal
135 --> $DIR/non-fmt-panic.rs:22:18
136 |
137LL | 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
142help: add a "{}" format string to Display the message
143 |
144LL | core::panic!("{}", &*"abc");
145 | ^^^^^
146
fc512014 147warning: panic message contains an unused formatting placeholder
5869c6ff 148 --> $DIR/non-fmt-panic.rs:23:12
fc512014
XL
149 |
150LL | 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
154help: add the missing argument
155 |
156LL | panic!(concat!("{", "}"), ...);
157 | ^^^^^
158help: or add a "{}" format string to use the message literally
159 |
160LL | panic!("{}", concat!("{", "}"));
161 | ^^^^^
162
163warning: panic message contains braces
5869c6ff 164 --> $DIR/non-fmt-panic.rs:24:5
fc512014
XL
165 |
166LL | panic!(concat!("{", "{"));
167 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
168 |
5869c6ff 169 = note: this message is not used as a format string, but will be in Rust 2021
fc512014
XL
170help: add a "{}" format string to use the message literally
171 |
172LL | panic!("{}", concat!("{", "{"));
173 | ^^^^^
174
175warning: panic message contains an unused formatting placeholder
5869c6ff 176 --> $DIR/non-fmt-panic.rs:26:37
fc512014
XL
177 |
178LL | 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
183warning: panic message is not a string literal
184 --> $DIR/non-fmt-panic.rs:29:31
185 |
186LL | 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
192warning: panic message is not a string literal
193 --> $DIR/non-fmt-panic.rs:36:12
194 |
195LL | 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
200help: add a "{}" format string to Display the message
201 |
202LL | panic!("{}", a!());
203 | ^^^^^
204help: or use std::panic::panic_any instead
205 |
206LL | std::panic::panic_any(a!());
207 | ^^^^^^^^^^^^^^^^^^^^^
208
209warning: panic message is not a string literal
210 --> $DIR/non-fmt-panic.rs:38:12
211 |
212LL | 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
218help: remove the `format!(..)` macro call
219 |
220LL | panic!("{}", 1);
221 | -- --
222
223warning: panic message is not a string literal
17df50a5
XL
224 --> $DIR/non-fmt-panic.rs:39:20
225 |
226LL | 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
232help: remove the `format!(..)` macro call
233 |
234LL | assert!(false, "{}", 1);
235 | -- --
236
237warning: panic message is not a string literal
238 --> $DIR/non-fmt-panic.rs:40:26
239 |
240LL | 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
246help: remove the `format!(..)` macro call
247 |
248LL | debug_assert!(false, "{}", 1);
249 | -- --
250
251warning: panic message is not a string literal
252 --> $DIR/non-fmt-panic.rs:42:12
6a06907d
XL
253 |
254LL | 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
259help: add a "{}" format string to Display the message
260 |
261LL | panic!["{}", 123];
262 | ^^^^^
263help: or use std::panic::panic_any instead
264 |
265LL | std::panic::panic_any(123);
266 | ^^^^^^^^^^^^^^^^^^^^^^ ^
267
268warning: panic message is not a string literal
17df50a5 269 --> $DIR/non-fmt-panic.rs:43:12
6a06907d
XL
270 |
271LL | 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
276help: add a "{}" format string to Display the message
277 |
278LL | panic!{"{}", 123};
279 | ^^^^^
280help: or use std::panic::panic_any instead
281 |
282LL | std::panic::panic_any(123);
283 | ^^^^^^^^^^^^^^^^^^^^^^ ^
284
17df50a5 285warning: 20 warnings emitted
fc512014 286