]> git.proxmox.com Git - rustc.git/blob - src/test/ui/non-fmt-panic.stderr
New upstream version 1.52.0~beta.3+dfsg1
[rustc.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_panic)]` 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 is no longer accepted in Rust 2021
65 help: add a "{}" format string to Display the message
66 |
67 LL | assert!(false, "{}", S);
68 | ^^^^^
69
70 warning: panic message contains braces
71 --> $DIR/non-fmt-panic.rs:18:27
72 |
73 LL | debug_assert!(false, "{{}} bla");
74 | ^^^^
75 |
76 = note: this message is not used as a format string, but will be in Rust 2021
77 help: add a "{}" format string to use the message literally
78 |
79 LL | debug_assert!(false, "{}", "{{}} bla");
80 | ^^^^^
81
82 warning: panic message is not a string literal
83 --> $DIR/non-fmt-panic.rs:19:12
84 |
85 LL | panic!(C);
86 | ^
87 |
88 = note: this is no longer accepted in Rust 2021
89 help: add a "{}" format string to Display the message
90 |
91 LL | panic!("{}", C);
92 | ^^^^^
93 help: or use std::panic::panic_any instead
94 |
95 LL | std::panic::panic_any(C);
96 | ^^^^^^^^^^^^^^^^^^^^^
97
98 warning: panic message is not a string literal
99 --> $DIR/non-fmt-panic.rs:20:12
100 |
101 LL | panic!(S);
102 | ^
103 |
104 = note: this is no longer accepted in Rust 2021
105 help: add a "{}" format string to Display the message
106 |
107 LL | panic!("{}", S);
108 | ^^^^^
109 help: or use std::panic::panic_any instead
110 |
111 LL | std::panic::panic_any(S);
112 | ^^^^^^^^^^^^^^^^^^^^^
113
114 warning: panic message is not a string literal
115 --> $DIR/non-fmt-panic.rs:21:17
116 |
117 LL | std::panic!(123);
118 | ^^^
119 |
120 = note: this is no longer accepted in Rust 2021
121 help: add a "{}" format string to Display the message
122 |
123 LL | std::panic!("{}", 123);
124 | ^^^^^
125 help: or use std::panic::panic_any instead
126 |
127 LL | std::panic::panic_any(123);
128 | ^^^^^^^^^^^^^^^^^^^^^
129
130 warning: panic message is not a string literal
131 --> $DIR/non-fmt-panic.rs:22:18
132 |
133 LL | core::panic!(&*"abc");
134 | ^^^^^^^
135 |
136 = note: this is no longer accepted in Rust 2021
137 help: add a "{}" format string to Display the message
138 |
139 LL | core::panic!("{}", &*"abc");
140 | ^^^^^
141
142 warning: panic message contains an unused formatting placeholder
143 --> $DIR/non-fmt-panic.rs:23:12
144 |
145 LL | panic!(concat!("{", "}"));
146 | ^^^^^^^^^^^^^^^^^
147 |
148 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
149 help: add the missing argument
150 |
151 LL | panic!(concat!("{", "}"), ...);
152 | ^^^^^
153 help: or add a "{}" format string to use the message literally
154 |
155 LL | panic!("{}", concat!("{", "}"));
156 | ^^^^^
157
158 warning: panic message contains braces
159 --> $DIR/non-fmt-panic.rs:24:5
160 |
161 LL | panic!(concat!("{", "{"));
162 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
163 |
164 = note: this message is not used as a format string, but will be in Rust 2021
165 help: add a "{}" format string to use the message literally
166 |
167 LL | panic!("{}", concat!("{", "{"));
168 | ^^^^^
169
170 warning: panic message contains an unused formatting placeholder
171 --> $DIR/non-fmt-panic.rs:26:37
172 |
173 LL | fancy_panic::fancy_panic!("test {} 123");
174 | ^^
175 |
176 = note: this message is not used as a format string when given without arguments, but will be in Rust 2021
177
178 warning: panic message is not a string literal
179 --> $DIR/non-fmt-panic.rs:29:31
180 |
181 LL | fancy_panic::fancy_panic!(S);
182 | ^
183 |
184 = note: this is no longer accepted in Rust 2021
185
186 warning: panic message is not a string literal
187 --> $DIR/non-fmt-panic.rs:36:12
188 |
189 LL | panic!(a!());
190 | ^^^^
191 |
192 = note: this is no longer accepted in Rust 2021
193 help: add a "{}" format string to Display the message
194 |
195 LL | panic!("{}", a!());
196 | ^^^^^
197 help: or use std::panic::panic_any instead
198 |
199 LL | std::panic::panic_any(a!());
200 | ^^^^^^^^^^^^^^^^^^^^^
201
202 warning: panic message is not a string literal
203 --> $DIR/non-fmt-panic.rs:38:12
204 |
205 LL | panic!(format!("{}", 1));
206 | ^^^^^^^^^^^^^^^^
207 |
208 = note: this is no longer accepted in Rust 2021
209 = note: the panic!() macro supports formatting, so there's no need for the format!() macro here
210 help: remove the `format!(..)` macro call
211 |
212 LL | panic!("{}", 1);
213 | -- --
214
215 warning: panic message is not a string literal
216 --> $DIR/non-fmt-panic.rs:40:12
217 |
218 LL | panic![123];
219 | ^^^
220 |
221 = note: this is no longer accepted in Rust 2021
222 help: add a "{}" format string to Display the message
223 |
224 LL | panic!["{}", 123];
225 | ^^^^^
226 help: or use std::panic::panic_any instead
227 |
228 LL | std::panic::panic_any(123);
229 | ^^^^^^^^^^^^^^^^^^^^^^ ^
230
231 warning: panic message is not a string literal
232 --> $DIR/non-fmt-panic.rs:41:12
233 |
234 LL | panic!{123};
235 | ^^^
236 |
237 = note: this is no longer accepted in Rust 2021
238 help: add a "{}" format string to Display the message
239 |
240 LL | panic!{"{}", 123};
241 | ^^^^^
242 help: or use std::panic::panic_any instead
243 |
244 LL | std::panic::panic_any(123);
245 | ^^^^^^^^^^^^^^^^^^^^^^ ^
246
247 warning: 18 warnings emitted
248