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: multiple unused formatting arguments
62 --> $DIR/ifmt-bad-arg.rs:32:17
64 LL | format!("", 1, 2);
65 | -- ^ ^ argument never used
67 | | argument never used
68 | multiple missing formatting specifiers
70 error: argument never used
71 --> $DIR/ifmt-bad-arg.rs:33:22
73 LL | format!("{}", 1, 2);
74 | ---- ^ argument never used
76 | formatting specifier missing
78 error: argument never used
79 --> $DIR/ifmt-bad-arg.rs:34:20
81 LL | format!("{1}", 1, 2);
82 | ----- ^ argument never used
84 | formatting specifier missing
86 error: named argument never used
87 --> $DIR/ifmt-bad-arg.rs:35:26
89 LL | format!("{}", 1, foo=2);
90 | ---- ^ named argument never used
92 | formatting specifier missing
94 error: argument never used
95 --> $DIR/ifmt-bad-arg.rs:36:22
97 LL | format!("{foo}", 1, foo=2);
98 | ------- ^ argument never used
100 | formatting specifier missing
102 error: named argument never used
103 --> $DIR/ifmt-bad-arg.rs:37:21
105 LL | format!("", foo=2);
106 | -- ^ named argument never used
108 | formatting specifier missing
110 error: multiple unused formatting arguments
111 --> $DIR/ifmt-bad-arg.rs:38:32
113 LL | format!("{} {}", 1, 2, foo=1, bar=2);
114 | ------- ^ ^ named argument never used
116 | | named argument never used
117 | multiple missing formatting specifiers
119 error: duplicate argument named `foo`
120 --> $DIR/ifmt-bad-arg.rs:40:33
122 LL | format!("{foo}", foo=1, foo=2);
123 | - ^ duplicate argument
127 error: positional arguments cannot follow named arguments
128 --> $DIR/ifmt-bad-arg.rs:41:35
130 LL | format!("{foo} {} {}", foo=1, 2);
131 | - ^ positional arguments must be before named arguments
135 error: named argument never used
136 --> $DIR/ifmt-bad-arg.rs:45:51
138 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
139 | ------------------- ^ named argument never used
141 | formatting specifier missing
143 error: invalid format string: expected `'}'` but string was terminated
144 --> $DIR/ifmt-bad-arg.rs:51:15
147 | -^ expected `'}'` in format string
149 | because of this opening brace
151 = note: if you intended to print `{`, you can escape it using `{{`
153 error: invalid format string: unmatched `}` found
154 --> $DIR/ifmt-bad-arg.rs:53:18
156 LL | format!("foo } bar");
157 | ^ unmatched `}` in format string
159 = note: if you intended to print `}`, you can escape it using `}}`
161 error: invalid format string: unmatched `}` found
162 --> $DIR/ifmt-bad-arg.rs:54:18
164 LL | format!("foo }");
165 | ^ unmatched `}` in format string
167 = note: if you intended to print `}`, you can escape it using `}}`
169 error: argument never used
170 --> $DIR/ifmt-bad-arg.rs:56:27
172 LL | format!("foo %s baz", "bar");
173 | -- ^^^^^ argument never used
175 | help: format specifiers use curly braces: `{}`
177 = note: printf formatting not supported; see the documentation for `std::fmt`
179 error: invalid format string: expected `'}'`, found `'t'`
180 --> $DIR/ifmt-bad-arg.rs:75:1
183 | - because of this opening brace
184 LL | tenth number: {}",
185 | ^ expected `}` in format string
187 = note: if you intended to print `{`, you can escape it using `{{`
189 error: 4 positional arguments in format string, but there are 3 arguments
190 --> $DIR/ifmt-bad-arg.rs:78:15
192 LL | println!("{} {:.*} {}", 1, 3.2, 4);
193 | ^^ ^^--^ ^^ - --- -
195 | | this parameter corresponds to the precision flag
196 | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
198 = note: positional arguments are zero-based
199 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
201 error: 4 positional arguments in format string, but there are 3 arguments
202 --> $DIR/ifmt-bad-arg.rs:81:15
204 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
205 | ^^ ^^^----^ ^^ - --- -
207 | | | this parameter corresponds to the precision flag
208 | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
209 | this width flag expects an `usize` argument at position 7, but there are 3 arguments
211 = note: positional arguments are zero-based
212 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
214 error: invalid reference to positional argument 7 (there are 3 arguments)
215 --> $DIR/ifmt-bad-arg.rs:84:18
217 LL | println!("{} {:07$} {}", 1, 3.2, 4);
220 | this width flag expects an `usize` argument at position 7, but there are 3 arguments
222 = note: positional arguments are zero-based
223 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
225 error: unknown format trait `foo`
226 --> $DIR/ifmt-bad-arg.rs:86:17
228 LL | println!("{:foo}", 1);
231 = note: the only appropriate formatting traits are:
232 - ``, which uses the `Display` trait
233 - `?`, which uses the `Debug` trait
234 - `e`, which uses the `LowerExp` trait
235 - `E`, which uses the `UpperExp` trait
236 - `o`, which uses the `Octal` trait
237 - `p`, which uses the `Pointer` trait
238 - `b`, which uses the `Binary` trait
239 - `x`, which uses the `LowerHex` trait
240 - `X`, which uses the `UpperHex` trait
242 error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument)
243 --> $DIR/ifmt-bad-arg.rs:87:15
245 LL | println!("{5} {:4$} {6:7$}", 1);
248 | | this width flag expects an `usize` argument at position 7, but there is 1 argument
249 | this width flag expects an `usize` argument at position 4, but there is 1 argument
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 0 (no arguments were given)
255 --> $DIR/ifmt-bad-arg.rs:90:15
257 LL | println!("{foo:0$}");
260 | this width flag expects an `usize` argument at position 0, but no arguments were given
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: 2 positional arguments in format string, but no arguments were given
266 --> $DIR/ifmt-bad-arg.rs:95:15
268 LL | println!("{:.*}");
271 | this precision flag adds an extra required argument at position 0, which is why there are 2 arguments expected
273 = note: positional arguments are zero-based
274 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
276 error[E0425]: cannot find value `foo` in this scope
277 --> $DIR/ifmt-bad-arg.rs:27:18
279 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
280 | ^^^ not found in this scope
282 error[E0425]: cannot find value `bar` in this scope
283 --> $DIR/ifmt-bad-arg.rs:27:27
285 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
286 | ^^^ not found in this scope
288 error[E0425]: cannot find value `foo` in this scope
289 --> $DIR/ifmt-bad-arg.rs:31:15
291 LL | format!("{foo}");
292 | ^^^ not found in this scope
294 error[E0425]: cannot find value `valueb` in this scope
295 --> $DIR/ifmt-bad-arg.rs:45:24
297 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
298 | ^^^^^^ not found in this scope
300 error[E0425]: cannot find value `foo` in this scope
301 --> $DIR/ifmt-bad-arg.rs:60:10
304 | ^^^ not found in this scope
306 error[E0308]: mismatched types
307 --> $DIR/ifmt-bad-arg.rs:78:32
309 LL | println!("{} {:.*} {}", 1, 3.2, 4);
310 | ---------------------------^^^----
312 | | expected `usize`, found floating-point number
313 | arguments to this function are incorrect
315 = note: expected reference `&usize`
316 found reference `&{float}`
317 note: associated function defined here
318 --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
320 LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
322 = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
324 error[E0308]: mismatched types
325 --> $DIR/ifmt-bad-arg.rs:81:35
327 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
328 | ------------------------------^^^----
330 | | expected `usize`, found floating-point number
331 | arguments to this function are incorrect
333 = note: expected reference `&usize`
334 found reference `&{float}`
335 note: associated function defined here
336 --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
338 LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
340 = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
342 error: aborting due to 37 previous errors
344 Some errors have detailed explanations: E0308, E0425.
345 For more information about an error, try `rustc --explain E0308`.