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 error: there is no argument named `bar`
68 --> $DIR/ifmt-bad-arg.rs:27:26
70 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
73 error: there is no argument named `foo`
74 --> $DIR/ifmt-bad-arg.rs:31:14
76 LL | format!("{foo}");
79 error: multiple unused formatting arguments
80 --> $DIR/ifmt-bad-arg.rs:32:17
82 LL | format!("", 1, 2);
83 | -- ^ ^ argument never used
85 | | argument never used
86 | multiple missing formatting specifiers
88 error: argument never used
89 --> $DIR/ifmt-bad-arg.rs:33:22
91 LL | format!("{}", 1, 2);
92 | ---- ^ argument never used
94 | formatting specifier missing
96 error: argument never used
97 --> $DIR/ifmt-bad-arg.rs:34:20
99 LL | format!("{1}", 1, 2);
100 | ----- ^ argument never used
102 | formatting specifier missing
104 error: named argument never used
105 --> $DIR/ifmt-bad-arg.rs:35:26
107 LL | format!("{}", 1, foo=2);
108 | ---- ^ named argument never used
110 | formatting specifier missing
112 error: argument never used
113 --> $DIR/ifmt-bad-arg.rs:36:22
115 LL | format!("{foo}", 1, foo=2);
116 | ------- ^ argument never used
118 | formatting specifier missing
120 error: named argument never used
121 --> $DIR/ifmt-bad-arg.rs:37:21
123 LL | format!("", foo=2);
124 | -- ^ named argument never used
126 | formatting specifier missing
128 error: multiple unused formatting arguments
129 --> $DIR/ifmt-bad-arg.rs:38:32
131 LL | format!("{} {}", 1, 2, foo=1, bar=2);
132 | ------- ^ ^ named argument never used
134 | | named argument never used
135 | multiple missing formatting specifiers
137 error: duplicate argument named `foo`
138 --> $DIR/ifmt-bad-arg.rs:40:33
140 LL | format!("{foo}", foo=1, foo=2);
141 | - ^ duplicate argument
145 error: positional arguments cannot follow named arguments
146 --> $DIR/ifmt-bad-arg.rs:41:35
148 LL | format!("{foo} {} {}", foo=1, 2);
149 | - ^ positional arguments must be before named arguments
153 error: there is no argument named `valueb`
154 --> $DIR/ifmt-bad-arg.rs:45:23
156 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
159 error: named argument never used
160 --> $DIR/ifmt-bad-arg.rs:45:51
162 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
163 | ------------------- ^ named argument never used
165 | formatting specifier missing
167 error: invalid format string: expected `'}'` but string was terminated
168 --> $DIR/ifmt-bad-arg.rs:51:15
171 | -^ expected `'}'` in format string
173 | because of this opening brace
175 = note: if you intended to print `{`, you can escape it using `{{`
177 error: invalid format string: unmatched `}` found
178 --> $DIR/ifmt-bad-arg.rs:53:18
180 LL | format!("foo } bar");
181 | ^ unmatched `}` in format string
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:54:18
188 LL | format!("foo }");
189 | ^ unmatched `}` in format string
191 = note: if you intended to print `}`, you can escape it using `}}`
193 error: argument never used
194 --> $DIR/ifmt-bad-arg.rs:56:27
196 LL | format!("foo %s baz", "bar");
197 | -- ^^^^^ argument never used
199 | help: format specifiers use curly braces: `{}`
201 = note: printf formatting not supported; see the documentation for `std::fmt`
203 error: there is no argument named `foo`
204 --> $DIR/ifmt-bad-arg.rs:60:9
209 error: invalid format string: expected `'}'`, found `'t'`
210 --> $DIR/ifmt-bad-arg.rs:75:1
213 | - because of this opening brace
214 LL | tenth number: {}",
215 | ^ expected `}` in format string
217 = note: if you intended to print `{`, you can escape it using `{{`
219 error: 4 positional arguments in format string, but there are 3 arguments
220 --> $DIR/ifmt-bad-arg.rs:78:15
222 LL | println!("{} {:.*} {}", 1, 3.2, 4);
223 | ^^ ^^--^ ^^ - --- -
225 | | this parameter corresponds to the precision flag
226 | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
228 = note: positional arguments are zero-based
229 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
231 error: 4 positional arguments in format string, but there are 3 arguments
232 --> $DIR/ifmt-bad-arg.rs:81:15
234 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
235 | ^^ ^^^----^ ^^ - --- -
237 | | | this parameter corresponds to the precision flag
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
241 = note: positional arguments are zero-based
242 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
244 error: invalid reference to positional argument 7 (there are 3 arguments)
245 --> $DIR/ifmt-bad-arg.rs:84:18
247 LL | println!("{} {:07$} {}", 1, 3.2, 4);
250 | this width flag expects an `usize` argument at position 7, but there are 3 arguments
252 = note: positional arguments are zero-based
253 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
255 error: unknown format trait `foo`
256 --> $DIR/ifmt-bad-arg.rs:86:17
258 LL | println!("{:foo}", 1);
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
272 error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument)
273 --> $DIR/ifmt-bad-arg.rs:87:15
275 LL | println!("{5} {:4$} {6:7$}", 1);
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
281 = note: positional arguments are zero-based
282 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
284 error: 2 positional arguments in format string, but no arguments were given
285 --> $DIR/ifmt-bad-arg.rs:92:15
287 LL | println!("{:.*}");
290 | this precision flag adds an extra required argument at position 0, which is why there are 2 arguments expected
292 = note: positional arguments are zero-based
293 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
295 error[E0308]: mismatched types
296 --> $DIR/ifmt-bad-arg.rs:78:32
298 LL | println!("{} {:.*} {}", 1, 3.2, 4);
299 | ^^^ expected `usize`, found floating-point number
301 = note: expected reference `&usize`
302 found reference `&{float}`
304 error[E0308]: mismatched types
305 --> $DIR/ifmt-bad-arg.rs:81:35
307 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
308 | ^^^ expected `usize`, found floating-point number
310 = note: expected reference `&usize`
311 found reference `&{float}`
313 error: aborting due to 36 previous errors
315 For more information about this error, try `rustc --explain E0308`.