]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error: 1 positional argument in format string, but no arguments were given |
0731742a | 2 | --> $DIR/ifmt-bad-arg.rs:6:14 |
8faf50e0 XL |
3 | | |
4 | LL | format!("{}"); | |
5 | | ^^ | |
6 | ||
7 | error: invalid reference to positional argument 1 (there is 1 argument) | |
0731742a | 8 | --> $DIR/ifmt-bad-arg.rs:9:14 |
8faf50e0 XL |
9 | | |
10 | LL | format!("{1}", 1); | |
11 | | ^^^ | |
12 | | | |
13 | = note: positional arguments are zero-based | |
14 | ||
15 | error: argument never used | |
0731742a | 16 | --> $DIR/ifmt-bad-arg.rs:9:20 |
8faf50e0 XL |
17 | | |
18 | LL | format!("{1}", 1); | |
0731742a | 19 | | ----- ^ argument never used |
8faf50e0 XL |
20 | | | |
21 | | formatting specifier missing | |
22 | ||
23 | error: 2 positional arguments in format string, but no arguments were given | |
0731742a | 24 | --> $DIR/ifmt-bad-arg.rs:13:14 |
8faf50e0 XL |
25 | | |
26 | LL | format!("{} {}"); | |
27 | | ^^ ^^ | |
28 | ||
29 | error: invalid reference to positional argument 1 (there is 1 argument) | |
0731742a | 30 | --> $DIR/ifmt-bad-arg.rs:16:18 |
8faf50e0 XL |
31 | | |
32 | LL | format!("{0} {1}", 1); | |
33 | | ^^^ | |
34 | | | |
35 | = note: positional arguments are zero-based | |
36 | ||
37 | error: invalid reference to positional argument 2 (there are 2 arguments) | |
0731742a | 38 | --> $DIR/ifmt-bad-arg.rs:19:22 |
8faf50e0 XL |
39 | | |
40 | LL | format!("{0} {1} {2}", 1, 2); | |
41 | | ^^^ | |
42 | | | |
43 | = note: positional arguments are zero-based | |
44 | ||
45 | error: invalid reference to positional argument 2 (there are 2 arguments) | |
0731742a | 46 | --> $DIR/ifmt-bad-arg.rs:22:28 |
8faf50e0 XL |
47 | | |
48 | LL | format!("{} {value} {} {}", 1, value=2); | |
49 | | ^^ | |
50 | | | |
51 | = note: positional arguments are zero-based | |
52 | ||
53 | error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) | |
0731742a | 54 | --> $DIR/ifmt-bad-arg.rs:24:38 |
8faf50e0 XL |
55 | | |
56 | LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); | |
57 | | ^^ ^^ ^^ | |
58 | | | |
59 | = note: positional arguments are zero-based | |
60 | ||
61 | error: there is no argument named `foo` | |
0731742a | 62 | --> $DIR/ifmt-bad-arg.rs:27:17 |
8faf50e0 XL |
63 | | |
64 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | |
65 | | ^^^^^ | |
66 | ||
67 | error: there is no argument named `bar` | |
0731742a | 68 | --> $DIR/ifmt-bad-arg.rs:27:26 |
8faf50e0 XL |
69 | | |
70 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | |
71 | | ^^^^^ | |
72 | ||
73 | error: there is no argument named `foo` | |
0731742a | 74 | --> $DIR/ifmt-bad-arg.rs:31:14 |
8faf50e0 | 75 | | |
532ac7d7 | 76 | LL | format!("{foo}"); |
8faf50e0 XL |
77 | | ^^^^^ |
78 | ||
79 | error: multiple unused formatting arguments | |
0731742a | 80 | --> $DIR/ifmt-bad-arg.rs:32:17 |
8faf50e0 | 81 | | |
532ac7d7 | 82 | LL | format!("", 1, 2); |
0731742a XL |
83 | | -- ^ ^ argument never used |
84 | | | | | |
85 | | | argument never used | |
8faf50e0 XL |
86 | | multiple missing formatting specifiers |
87 | ||
88 | error: argument never used | |
0731742a | 89 | --> $DIR/ifmt-bad-arg.rs:33:22 |
8faf50e0 | 90 | | |
532ac7d7 | 91 | LL | format!("{}", 1, 2); |
0731742a | 92 | | ---- ^ argument never used |
8faf50e0 XL |
93 | | | |
94 | | formatting specifier missing | |
95 | ||
96 | error: argument never used | |
0731742a | 97 | --> $DIR/ifmt-bad-arg.rs:34:20 |
8faf50e0 | 98 | | |
532ac7d7 | 99 | LL | format!("{1}", 1, 2); |
0731742a | 100 | | ----- ^ argument never used |
8faf50e0 XL |
101 | | | |
102 | | formatting specifier missing | |
103 | ||
104 | error: named argument never used | |
0731742a | 105 | --> $DIR/ifmt-bad-arg.rs:35:26 |
8faf50e0 | 106 | | |
532ac7d7 | 107 | LL | format!("{}", 1, foo=2); |
0731742a | 108 | | ---- ^ named argument never used |
8faf50e0 XL |
109 | | | |
110 | | formatting specifier missing | |
111 | ||
112 | error: argument never used | |
0731742a | 113 | --> $DIR/ifmt-bad-arg.rs:36:22 |
8faf50e0 | 114 | | |
532ac7d7 | 115 | LL | format!("{foo}", 1, foo=2); |
0731742a | 116 | | ------- ^ argument never used |
8faf50e0 XL |
117 | | | |
118 | | formatting specifier missing | |
119 | ||
120 | error: named argument never used | |
0731742a | 121 | --> $DIR/ifmt-bad-arg.rs:37:21 |
8faf50e0 | 122 | | |
532ac7d7 | 123 | LL | format!("", foo=2); |
0731742a | 124 | | -- ^ named argument never used |
8faf50e0 XL |
125 | | | |
126 | | formatting specifier missing | |
127 | ||
128 | error: multiple unused formatting arguments | |
0731742a | 129 | --> $DIR/ifmt-bad-arg.rs:38:32 |
8faf50e0 | 130 | | |
532ac7d7 | 131 | LL | format!("{} {}", 1, 2, foo=1, bar=2); |
0731742a XL |
132 | | ------- ^ ^ named argument never used |
133 | | | | | |
134 | | | named argument never used | |
8faf50e0 XL |
135 | | multiple missing formatting specifiers |
136 | ||
137 | error: duplicate argument named `foo` | |
0731742a | 138 | --> $DIR/ifmt-bad-arg.rs:40:33 |
8faf50e0 | 139 | | |
532ac7d7 | 140 | LL | format!("{foo}", foo=1, foo=2); |
60c5eb7d XL |
141 | | - ^ duplicate argument |
142 | | | | |
143 | | previously here | |
8faf50e0 | 144 | |
416331ca XL |
145 | error: positional arguments cannot follow named arguments |
146 | --> $DIR/ifmt-bad-arg.rs:41:35 | |
8faf50e0 | 147 | | |
416331ca XL |
148 | LL | format!("{foo} {} {}", foo=1, 2); |
149 | | - ^ positional arguments must be before named arguments | |
150 | | | | |
151 | | named argument | |
8faf50e0 XL |
152 | |
153 | error: there is no argument named `valueb` | |
0731742a | 154 | --> $DIR/ifmt-bad-arg.rs:45:23 |
8faf50e0 XL |
155 | | |
156 | LL | format!("{valuea} {valueb}", valuea=5, valuec=7); | |
157 | | ^^^^^^^^ | |
158 | ||
159 | error: named argument never used | |
0731742a | 160 | --> $DIR/ifmt-bad-arg.rs:45:51 |
8faf50e0 XL |
161 | | |
162 | LL | format!("{valuea} {valueb}", valuea=5, valuec=7); | |
0731742a | 163 | | ------------------- ^ named argument never used |
8faf50e0 XL |
164 | | | |
165 | | formatting specifier missing | |
166 | ||
167 | error: invalid format string: expected `'}'` but string was terminated | |
0731742a | 168 | --> $DIR/ifmt-bad-arg.rs:51:15 |
8faf50e0 | 169 | | |
532ac7d7 | 170 | LL | format!("{"); |
0731742a XL |
171 | | -^ expected `'}'` in format string |
172 | | | | |
173 | | because of this opening brace | |
8faf50e0 XL |
174 | | |
175 | = note: if you intended to print `{`, you can escape it using `{{` | |
176 | ||
177 | error: invalid format string: unmatched `}` found | |
0731742a | 178 | --> $DIR/ifmt-bad-arg.rs:53:18 |
8faf50e0 | 179 | | |
532ac7d7 | 180 | LL | format!("foo } bar"); |
8faf50e0 XL |
181 | | ^ unmatched `}` in format string |
182 | | | |
183 | = note: if you intended to print `}`, you can escape it using `}}` | |
184 | ||
185 | error: invalid format string: unmatched `}` found | |
0731742a | 186 | --> $DIR/ifmt-bad-arg.rs:54:18 |
8faf50e0 | 187 | | |
532ac7d7 | 188 | LL | format!("foo }"); |
8faf50e0 XL |
189 | | ^ unmatched `}` in format string |
190 | | | |
191 | = note: if you intended to print `}`, you can escape it using `}}` | |
192 | ||
193 | error: argument never used | |
0731742a | 194 | --> $DIR/ifmt-bad-arg.rs:56:27 |
8faf50e0 | 195 | | |
532ac7d7 | 196 | LL | format!("foo %s baz", "bar"); |
0731742a | 197 | | -- ^^^^^ argument never used |
8faf50e0 XL |
198 | | | |
199 | | help: format specifiers use curly braces: `{}` | |
200 | | | |
201 | = note: printf formatting not supported; see the documentation for `std::fmt` | |
202 | ||
203 | error: there is no argument named `foo` | |
0731742a | 204 | --> $DIR/ifmt-bad-arg.rs:60:9 |
8faf50e0 XL |
205 | | |
206 | LL | {foo} | |
207 | | ^^^^^ | |
208 | ||
0bf4aa26 | 209 | error: invalid format string: expected `'}'`, found `'t'` |
0731742a | 210 | --> $DIR/ifmt-bad-arg.rs:75:1 |
0bf4aa26 | 211 | | |
0731742a XL |
212 | LL | ninth number: { |
213 | | - because of this opening brace | |
0bf4aa26 XL |
214 | LL | tenth number: {}", |
215 | | ^ expected `}` in format string | |
0731742a XL |
216 | | |
217 | = note: if you intended to print `{`, you can escape it using `{{` | |
0bf4aa26 | 218 | |
416331ca XL |
219 | error: 4 positional arguments in format string, but there are 3 arguments |
220 | --> $DIR/ifmt-bad-arg.rs:78:15 | |
221 | | | |
222 | LL | println!("{} {:.*} {}", 1, 3.2, 4); | |
e74abb32 XL |
223 | | ^^ ^^--^ ^^ - --- - |
224 | | | | | |
225 | | | this parameter corresponds to the precision flag | |
416331ca XL |
226 | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected |
227 | | | |
228 | = note: positional arguments are zero-based | |
229 | = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html | |
230 | ||
231 | error: 4 positional arguments in format string, but there are 3 arguments | |
232 | --> $DIR/ifmt-bad-arg.rs:81:15 | |
233 | | | |
234 | LL | println!("{} {:07$.*} {}", 1, 3.2, 4); | |
e74abb32 XL |
235 | | ^^ ^^^----^ ^^ - --- - |
236 | | | | | | |
237 | | | | this parameter corresponds to the precision flag | |
416331ca XL |
238 | | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected |
239 | | this width flag expects an `usize` argument at position 7, but there are 3 arguments | |
240 | | | |
241 | = note: positional arguments are zero-based | |
242 | = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html | |
243 | ||
244 | error: invalid reference to positional argument 7 (there are 3 arguments) | |
245 | --> $DIR/ifmt-bad-arg.rs:84:18 | |
246 | | | |
247 | LL | println!("{} {:07$} {}", 1, 3.2, 4); | |
248 | | ^^^--^ | |
249 | | | | |
250 | | this width flag expects an `usize` argument at position 7, but there are 3 arguments | |
251 | | | |
252 | = note: positional arguments are zero-based | |
253 | = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html | |
254 | ||
255 | error: unknown format trait `foo` | |
60c5eb7d | 256 | --> $DIR/ifmt-bad-arg.rs:86:17 |
416331ca XL |
257 | | |
258 | LL | println!("{:foo}", 1); | |
60c5eb7d | 259 | | ^^^ |
416331ca XL |
260 | | |
261 | = note: the only appropriate formatting traits are: | |
262 | - ``, which uses the `Display` trait | |
263 | - `?`, which uses the `Debug` trait | |
264 | - `e`, which uses the `LowerExp` trait | |
265 | - `E`, which uses the `UpperExp` trait | |
266 | - `o`, which uses the `Octal` trait | |
267 | - `p`, which uses the `Pointer` trait | |
268 | - `b`, which uses the `Binary` trait | |
269 | - `x`, which uses the `LowerHex` trait | |
270 | - `X`, which uses the `UpperHex` trait | |
271 | ||
272 | error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument) | |
273 | --> $DIR/ifmt-bad-arg.rs:87:15 | |
274 | | | |
275 | LL | println!("{5} {:4$} {6:7$}", 1); | |
276 | | ^^^ ^^--^ ^^^--^ | |
277 | | | | | |
278 | | | this width flag expects an `usize` argument at position 7, but there is 1 argument | |
279 | | this width flag expects an `usize` argument at position 4, but there is 1 argument | |
280 | | | |
281 | = note: positional arguments are zero-based | |
282 | = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html | |
283 | ||
e74abb32 XL |
284 | error: 2 positional arguments in format string, but no arguments were given |
285 | --> $DIR/ifmt-bad-arg.rs:92:15 | |
286 | | | |
287 | LL | println!("{:.*}"); | |
288 | | ^^--^ | |
289 | | | | |
290 | | this precision flag adds an extra required argument at position 0, which is why there are 2 arguments expected | |
291 | | | |
292 | = note: positional arguments are zero-based | |
293 | = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html | |
294 | ||
416331ca XL |
295 | error[E0308]: mismatched types |
296 | --> $DIR/ifmt-bad-arg.rs:78:32 | |
297 | | | |
298 | LL | println!("{} {:.*} {}", 1, 3.2, 4); | |
60c5eb7d | 299 | | ^^^ expected `usize`, found floating-point number |
416331ca | 300 | | |
60c5eb7d XL |
301 | = note: expected reference `&usize` |
302 | found reference `&{float}` | |
74b04a01 | 303 | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) |
416331ca XL |
304 | |
305 | error[E0308]: mismatched types | |
306 | --> $DIR/ifmt-bad-arg.rs:81:35 | |
307 | | | |
308 | LL | println!("{} {:07$.*} {}", 1, 3.2, 4); | |
60c5eb7d | 309 | | ^^^ expected `usize`, found floating-point number |
416331ca | 310 | | |
60c5eb7d XL |
311 | = note: expected reference `&usize` |
312 | found reference `&{float}` | |
74b04a01 | 313 | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) |
416331ca | 314 | |
e74abb32 | 315 | error: aborting due to 36 previous errors |
8faf50e0 | 316 | |
416331ca | 317 | For more information about this error, try `rustc --explain E0308`. |