1 error: 1 positional argument in format string, but no arguments were given
2 --> $DIR/ifmt-bad-arg.rs:6:14
7 error: invalid reference to positional argument 1 (there is 1 argument)
8 --> $DIR/ifmt-bad-arg.rs:9:14
10 LL | format!("{1}", 1);
13 = note: positional arguments are zero-based
15 error: argument never used
16 --> $DIR/ifmt-bad-arg.rs:9:20
18 LL | format!("{1}", 1);
19 | ----- ^ argument never used
21 | formatting specifier missing
23 error: 2 positional arguments in format string, but no arguments were given
24 --> $DIR/ifmt-bad-arg.rs:13:14
26 LL | format!("{} {}");
29 error: invalid reference to positional argument 1 (there is 1 argument)
30 --> $DIR/ifmt-bad-arg.rs:16:18
32 LL | format!("{0} {1}", 1);
35 = note: positional arguments are zero-based
37 error: invalid reference to positional argument 2 (there are 2 arguments)
38 --> $DIR/ifmt-bad-arg.rs:19:22
40 LL | format!("{0} {1} {2}", 1, 2);
43 = note: positional arguments are zero-based
45 error: invalid reference to positional argument 2 (there are 2 arguments)
46 --> $DIR/ifmt-bad-arg.rs:22:28
48 LL | format!("{} {value} {} {}", 1, value=2);
51 = note: positional arguments are zero-based
53 error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
54 --> $DIR/ifmt-bad-arg.rs:24:38
56 LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
59 = note: positional arguments are zero-based
61 error: there is no argument named `foo`
62 --> $DIR/ifmt-bad-arg.rs:27:17
64 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
67 = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes
69 error: there is no argument named `bar`
70 --> $DIR/ifmt-bad-arg.rs:27:26
72 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
75 = help: if you intended to capture `bar` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes
77 error: there is no argument named `foo`
78 --> $DIR/ifmt-bad-arg.rs:31:14
80 LL | format!("{foo}");
83 = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes
85 error: multiple unused formatting arguments
86 --> $DIR/ifmt-bad-arg.rs:32:17
88 LL | format!("", 1, 2);
89 | -- ^ ^ argument never used
91 | | argument never used
92 | multiple missing formatting specifiers
94 error: argument never used
95 --> $DIR/ifmt-bad-arg.rs:33:22
97 LL | format!("{}", 1, 2);
98 | ---- ^ argument never used
100 | formatting specifier missing
102 error: argument never used
103 --> $DIR/ifmt-bad-arg.rs:34:20
105 LL | format!("{1}", 1, 2);
106 | ----- ^ argument never used
108 | formatting specifier missing
110 error: named argument never used
111 --> $DIR/ifmt-bad-arg.rs:35:26
113 LL | format!("{}", 1, foo=2);
114 | ---- ^ named argument never used
116 | formatting specifier missing
118 error: argument never used
119 --> $DIR/ifmt-bad-arg.rs:36:22
121 LL | format!("{foo}", 1, foo=2);
122 | ------- ^ argument never used
124 | formatting specifier missing
126 error: named argument never used
127 --> $DIR/ifmt-bad-arg.rs:37:21
129 LL | format!("", foo=2);
130 | -- ^ named argument never used
132 | formatting specifier missing
134 error: multiple unused formatting arguments
135 --> $DIR/ifmt-bad-arg.rs:38:32
137 LL | format!("{} {}", 1, 2, foo=1, bar=2);
138 | ------- ^ ^ named argument never used
140 | | named argument never used
141 | multiple missing formatting specifiers
143 error: duplicate argument named `foo`
144 --> $DIR/ifmt-bad-arg.rs:40:33
146 LL | format!("{foo}", foo=1, foo=2);
147 | - ^ duplicate argument
151 error: positional arguments cannot follow named arguments
152 --> $DIR/ifmt-bad-arg.rs:41:35
154 LL | format!("{foo} {} {}", foo=1, 2);
155 | - ^ positional arguments must be before named arguments
159 error: there is no argument named `valueb`
160 --> $DIR/ifmt-bad-arg.rs:45:23
162 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
165 = help: if you intended to capture `valueb` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes
167 error: named argument never used
168 --> $DIR/ifmt-bad-arg.rs:45:51
170 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
171 | ------------------- ^ named argument never used
173 | formatting specifier missing
175 error: invalid format string: expected `'}'` but string was terminated
176 --> $DIR/ifmt-bad-arg.rs:51:15
179 | -^ expected `'}'` in format string
181 | because of this opening brace
183 = note: if you intended to print `{`, you can escape it using `{{`
185 error: invalid format string: unmatched `}` found
186 --> $DIR/ifmt-bad-arg.rs:53:18
188 LL | format!("foo } bar");
189 | ^ unmatched `}` in format string
191 = note: if you intended to print `}`, you can escape it using `}}`
193 error: invalid format string: unmatched `}` found
194 --> $DIR/ifmt-bad-arg.rs:54:18
196 LL | format!("foo }");
197 | ^ unmatched `}` in format string
199 = note: if you intended to print `}`, you can escape it using `}}`
201 error: argument never used
202 --> $DIR/ifmt-bad-arg.rs:56:27
204 LL | format!("foo %s baz", "bar");
205 | -- ^^^^^ argument never used
207 | help: format specifiers use curly braces: `{}`
209 = note: printf formatting not supported; see the documentation for `std::fmt`
211 error: there is no argument named `foo`
212 --> $DIR/ifmt-bad-arg.rs:60:9
217 = help: if you intended to capture `foo` from the surrounding scope, add `#![feature(format_args_capture)]` to the crate attributes
219 error: invalid format string: expected `'}'`, found `'t'`
220 --> $DIR/ifmt-bad-arg.rs:75:1
223 | - because of this opening brace
224 LL | tenth number: {}",
225 | ^ expected `}` in format string
227 = note: if you intended to print `{`, you can escape it using `{{`
229 error: 4 positional arguments in format string, but there are 3 arguments
230 --> $DIR/ifmt-bad-arg.rs:78:15
232 LL | println!("{} {:.*} {}", 1, 3.2, 4);
233 | ^^ ^^--^ ^^ - --- -
235 | | this parameter corresponds to the precision flag
236 | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
238 = note: positional arguments are zero-based
239 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
241 error: 4 positional arguments in format string, but there are 3 arguments
242 --> $DIR/ifmt-bad-arg.rs:81:15
244 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
245 | ^^ ^^^----^ ^^ - --- -
247 | | | this parameter corresponds to the precision flag
248 | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
249 | this width flag expects an `usize` argument at position 7, but there are 3 arguments
251 = note: positional arguments are zero-based
252 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
254 error: invalid reference to positional argument 7 (there are 3 arguments)
255 --> $DIR/ifmt-bad-arg.rs:84:18
257 LL | println!("{} {:07$} {}", 1, 3.2, 4);
260 | this width flag expects an `usize` argument at position 7, but there are 3 arguments
262 = note: positional arguments are zero-based
263 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
265 error: unknown format trait `foo`
266 --> $DIR/ifmt-bad-arg.rs:86:17
268 LL | println!("{:foo}", 1);
271 = note: the only appropriate formatting traits are:
272 - ``, which uses the `Display` trait
273 - `?`, which uses the `Debug` trait
274 - `e`, which uses the `LowerExp` trait
275 - `E`, which uses the `UpperExp` trait
276 - `o`, which uses the `Octal` trait
277 - `p`, which uses the `Pointer` trait
278 - `b`, which uses the `Binary` trait
279 - `x`, which uses the `LowerHex` trait
280 - `X`, which uses the `UpperHex` trait
282 error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument)
283 --> $DIR/ifmt-bad-arg.rs:87:15
285 LL | println!("{5} {:4$} {6:7$}", 1);
288 | | this width flag expects an `usize` argument at position 7, but there is 1 argument
289 | this width flag expects an `usize` argument at position 4, but there is 1 argument
291 = note: positional arguments are zero-based
292 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
294 error: 2 positional arguments in format string, but no arguments were given
295 --> $DIR/ifmt-bad-arg.rs:92:15
297 LL | println!("{:.*}");
300 | this precision flag adds an extra required argument at position 0, which is why there are 2 arguments expected
302 = note: positional arguments are zero-based
303 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
305 error[E0308]: mismatched types
306 --> $DIR/ifmt-bad-arg.rs:78:32
308 LL | println!("{} {:.*} {}", 1, 3.2, 4);
309 | ^^^ expected `usize`, found floating-point number
311 = note: expected reference `&usize`
312 found reference `&{float}`
313 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
315 error[E0308]: mismatched types
316 --> $DIR/ifmt-bad-arg.rs:81:35
318 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
319 | ^^^ expected `usize`, found floating-point number
321 = note: expected reference `&usize`
322 found reference `&{float}`
323 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
325 error: aborting due to 36 previous errors
327 For more information about this error, try `rustc --explain E0308`.