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:15
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:19
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:23
40 LL | format!("{0} {1} {2}", 1, 2);
43 = note: positional arguments are zero-based
45 error: 3 positional arguments in format string, but there are 2 arguments
46 --> $DIR/ifmt-bad-arg.rs:22:14
48 LL | format!("{} {value} {} {}", 1, value=2);
51 error: 6 positional arguments in format string, but there are 3 arguments
52 --> $DIR/ifmt-bad-arg.rs:24:29
54 LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
55 | ^^ ^^ ^^ ^^ ^^ ^^ - - -
57 error: multiple unused formatting arguments
58 --> $DIR/ifmt-bad-arg.rs:32:17
60 LL | format!("", 1, 2);
61 | -- ^ ^ argument never used
63 | | argument never used
64 | multiple missing formatting specifiers
66 error: argument never used
67 --> $DIR/ifmt-bad-arg.rs:33:22
69 LL | format!("{}", 1, 2);
70 | ---- ^ argument never used
72 | formatting specifier missing
74 error: argument never used
75 --> $DIR/ifmt-bad-arg.rs:34:20
77 LL | format!("{1}", 1, 2);
78 | ----- ^ argument never used
80 | formatting specifier missing
82 error: named argument never used
83 --> $DIR/ifmt-bad-arg.rs:35:26
85 LL | format!("{}", 1, foo=2);
86 | ---- ^ named argument never used
88 | formatting specifier missing
90 error: argument never used
91 --> $DIR/ifmt-bad-arg.rs:36:22
93 LL | format!("{foo}", 1, foo=2);
94 | ------- ^ argument never used
96 | formatting specifier missing
98 error: named argument never used
99 --> $DIR/ifmt-bad-arg.rs:37:21
101 LL | format!("", foo=2);
102 | -- ^ named argument never used
104 | formatting specifier missing
106 error: multiple unused formatting arguments
107 --> $DIR/ifmt-bad-arg.rs:38:32
109 LL | format!("{} {}", 1, 2, foo=1, bar=2);
110 | ------- ^ ^ named argument never used
112 | | named argument never used
113 | multiple missing formatting specifiers
115 error: duplicate argument named `foo`
116 --> $DIR/ifmt-bad-arg.rs:40:29
118 LL | format!("{foo}", foo=1, foo=2);
119 | --- ^^^ duplicate argument
123 error: positional arguments cannot follow named arguments
124 --> $DIR/ifmt-bad-arg.rs:41:35
126 LL | format!("{foo} {} {}", foo=1, 2);
127 | ----- ^ positional arguments must be before named arguments
131 error: named argument never used
132 --> $DIR/ifmt-bad-arg.rs:45:51
134 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
135 | ------------------- ^ named argument never used
137 | formatting specifier missing
139 error: invalid format string: expected `'}'` but string was terminated
140 --> $DIR/ifmt-bad-arg.rs:51:15
143 | -^ expected `'}'` in format string
145 | because of this opening brace
147 = note: if you intended to print `{`, you can escape it using `{{`
149 error: invalid format string: unmatched `}` found
150 --> $DIR/ifmt-bad-arg.rs:53:18
152 LL | format!("foo } bar");
153 | ^ unmatched `}` in format string
155 = note: if you intended to print `}`, you can escape it using `}}`
157 error: invalid format string: unmatched `}` found
158 --> $DIR/ifmt-bad-arg.rs:54:18
160 LL | format!("foo }");
161 | ^ unmatched `}` in format string
163 = note: if you intended to print `}`, you can escape it using `}}`
165 error: argument never used
166 --> $DIR/ifmt-bad-arg.rs:56:27
168 LL | format!("foo %s baz", "bar");
169 | -- ^^^^^ argument never used
171 | help: format specifiers use curly braces: `{}`
173 = note: printf formatting is not supported; see the documentation for `std::fmt`
175 error: invalid format string: expected `'}'`, found `'t'`
176 --> $DIR/ifmt-bad-arg.rs:75:1
179 | - because of this opening brace
180 LL | tenth number: {}",
181 | ^ expected `}` in format string
183 = note: if you intended to print `{`, you can escape it using `{{`
185 error: 4 positional arguments in format string, but there are 3 arguments
186 --> $DIR/ifmt-bad-arg.rs:78:15
188 LL | println!("{} {:.*} {}", 1, 3.2, 4);
189 | ^^ ^^--^ ^^ - --- -
191 | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
193 = note: positional arguments are zero-based
194 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
196 error: invalid reference to positional arguments 3 and 7 (there are 3 arguments)
197 --> $DIR/ifmt-bad-arg.rs:81:21
199 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
202 = note: positional arguments are zero-based
203 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
205 error: invalid reference to positional argument 7 (there are 3 arguments)
206 --> $DIR/ifmt-bad-arg.rs:84:21
208 LL | println!("{} {:07$} {}", 1, 3.2, 4);
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: unknown format trait `foo`
215 --> $DIR/ifmt-bad-arg.rs:86:17
217 LL | println!("{:foo}", 1);
220 = note: the only appropriate formatting traits are:
221 - ``, which uses the `Display` trait
222 - `?`, which uses the `Debug` trait
223 - `e`, which uses the `LowerExp` trait
224 - `E`, which uses the `UpperExp` trait
225 - `o`, which uses the `Octal` trait
226 - `p`, which uses the `Pointer` trait
227 - `b`, which uses the `Binary` trait
228 - `x`, which uses the `LowerHex` trait
229 - `X`, which uses the `UpperHex` trait
231 error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument)
232 --> $DIR/ifmt-bad-arg.rs:87:16
234 LL | println!("{5} {:4$} {6:7$}", 1);
237 = note: positional arguments are zero-based
238 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
240 error: invalid reference to positional argument 0 (no arguments were given)
241 --> $DIR/ifmt-bad-arg.rs:90:20
243 LL | println!("{foo:0$}");
246 = note: positional arguments are zero-based
247 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
249 error: 2 positional arguments in format string, but no arguments were given
250 --> $DIR/ifmt-bad-arg.rs:95:15
252 LL | println!("{:.*}");
255 | this precision flag adds an extra required argument at position 0, which is why there are 2 arguments expected
257 = note: positional arguments are zero-based
258 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
260 error: invalid reference to positional argument 0 (no arguments were given)
261 --> $DIR/ifmt-bad-arg.rs:97:16
263 LL | println!("{:.0$}");
266 = note: positional arguments are zero-based
267 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
269 error[E0425]: cannot find value `foo` in this scope
270 --> $DIR/ifmt-bad-arg.rs:27:18
272 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
273 | ^^^ not found in this scope
275 error[E0425]: cannot find value `bar` in this scope
276 --> $DIR/ifmt-bad-arg.rs:27:27
278 LL | format!("{} {foo} {} {bar} {}", 1, 2, 3);
279 | ^^^ not found in this scope
281 error[E0425]: cannot find value `foo` in this scope
282 --> $DIR/ifmt-bad-arg.rs:31:15
284 LL | format!("{foo}");
285 | ^^^ not found in this scope
287 error[E0425]: cannot find value `valueb` in this scope
288 --> $DIR/ifmt-bad-arg.rs:45:24
290 LL | format!("{valuea} {valueb}", valuea=5, valuec=7);
291 | ^^^^^^ not found in this scope
293 error[E0425]: cannot find value `foo` in this scope
294 --> $DIR/ifmt-bad-arg.rs:60:10
297 | ^^^ not found in this scope
299 error[E0308]: mismatched types
300 --> $DIR/ifmt-bad-arg.rs:78:32
302 LL | println!("{} {:.*} {}", 1, 3.2, 4);
305 | expected `usize`, found floating-point number
306 | arguments to this function are incorrect
308 = note: expected reference `&usize`
309 found reference `&{float}`
310 note: associated function defined here
311 --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
312 = 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)
314 error[E0308]: mismatched types
315 --> $DIR/ifmt-bad-arg.rs:81:35
317 LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
320 | expected `usize`, found floating-point number
321 | arguments to this function are incorrect
323 = note: expected reference `&usize`
324 found reference `&{float}`
325 note: associated function defined here
326 --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
327 = 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)
329 error: aborting due to 38 previous errors
331 Some errors have detailed explanations: E0308, E0425.
332 For more information about an error, try `rustc --explain E0308`.