@@ -5,10 +5,10 @@ LL | format!("{}");
55 | ^^
66
77error: invalid reference to positional argument 1 (there is 1 argument)
8- --> $DIR/ifmt-bad-arg.rs:9:14
8+ --> $DIR/ifmt-bad-arg.rs:9:15
99 |
1010LL | format!("{1}", 1);
11- | ^^ ^
11+ | ^
1212 |
1313 = note: positional arguments are zero-based
1414
@@ -27,36 +27,32 @@ LL | format!("{} {}");
2727 | ^^ ^^
2828
2929error: invalid reference to positional argument 1 (there is 1 argument)
30- --> $DIR/ifmt-bad-arg.rs:16:18
30+ --> $DIR/ifmt-bad-arg.rs:16:19
3131 |
3232LL | format!("{0} {1}", 1);
33- | ^^ ^
33+ | ^
3434 |
3535 = note: positional arguments are zero-based
3636
3737error: invalid reference to positional argument 2 (there are 2 arguments)
38- --> $DIR/ifmt-bad-arg.rs:19:22
38+ --> $DIR/ifmt-bad-arg.rs:19:23
3939 |
4040LL | format!("{0} {1} {2}", 1, 2);
41- | ^^ ^
41+ | ^
4242 |
4343 = note: positional arguments are zero-based
4444
45- error: invalid reference to positional argument 2 ( there are 2 arguments)
46- --> $DIR/ifmt-bad-arg.rs:22:28
45+ error: 3 positional arguments in format string, but there are 2 arguments
46+ --> $DIR/ifmt-bad-arg.rs:22:14
4747 |
4848LL | format!("{} {value} {} {}", 1, value=2);
49- | ^^
50- |
51- = note: positional arguments are zero-based
49+ | ^^ ^^ ^^ - -
5250
53- error: invalid reference to positional arguments 3, 4 and 5 ( there are 3 arguments)
54- --> $DIR/ifmt-bad-arg.rs:24:38
51+ error: 6 positional arguments in format string, but there are 3 arguments
52+ --> $DIR/ifmt-bad-arg.rs:24:29
5553 |
5654LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
57- | ^^ ^^ ^^
58- |
59- = note: positional arguments are zero-based
55+ | ^^ ^^ ^^ ^^ ^^ ^^ - - -
6056
6157error: multiple unused formatting arguments
6258 --> $DIR/ifmt-bad-arg.rs:32:17
@@ -191,33 +187,26 @@ error: 4 positional arguments in format string, but there are 3 arguments
191187 |
192188LL | println!("{} {:.*} {}", 1, 3.2, 4);
193189 | ^^ ^^--^ ^^ - --- -
194- | | |
195- | | this parameter corresponds to the precision flag
190+ | |
196191 | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
197192 |
198193 = note: positional arguments are zero-based
199194 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
200195
201- error: 4 positional arguments in format string, but there are 3 arguments
202- --> $DIR/ifmt-bad-arg.rs:81:15
196+ error: invalid reference to positional arguments 3 and 7 ( there are 3 arguments)
197+ --> $DIR/ifmt-bad-arg.rs:81:21
203198 |
204199LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
205- | ^^ ^^^----^ ^^ - --- -
206- | | | |
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
200+ | ^^ ^
210201 |
211202 = note: positional arguments are zero-based
212203 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
213204
214205error: invalid reference to positional argument 7 (there are 3 arguments)
215- --> $DIR/ifmt-bad-arg.rs:84:18
206+ --> $DIR/ifmt-bad-arg.rs:84:21
216207 |
217208LL | println!("{} {:07$} {}", 1, 3.2, 4);
218- | ^^^--^
219- | |
220- | this width flag expects an `usize` argument at position 7, but there are 3 arguments
209+ | ^^
221210 |
222211 = note: positional arguments are zero-based
223212 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
@@ -240,24 +229,19 @@ LL | println!("{:foo}", 1);
240229 - `X`, which uses the `UpperHex` trait
241230
242231error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument)
243- --> $DIR/ifmt-bad-arg.rs:87:15
232+ --> $DIR/ifmt-bad-arg.rs:87:16
244233 |
245234LL | println!("{5} {:4$} {6:7$}", 1);
246- | ^^^ ^^--^ ^^^--^
247- | | |
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
235+ | ^ ^^ ^ ^^
250236 |
251237 = note: positional arguments are zero-based
252238 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
253239
254240error: invalid reference to positional argument 0 (no arguments were given)
255- --> $DIR/ifmt-bad-arg.rs:90:15
241+ --> $DIR/ifmt-bad-arg.rs:90:20
256242 |
257243LL | println!("{foo:0$}");
258- | ^^^^^--^
259- | |
260- | this width flag expects an `usize` argument at position 0, but no arguments were given
244+ | ^^
261245 |
262246 = note: positional arguments are zero-based
263247 = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
@@ -318,10 +302,10 @@ error[E0308]: mismatched types
318302 --> $DIR/ifmt-bad-arg.rs:78:32
319303 |
320304LL | println!("{} {:.*} {}", 1, 3.2, 4);
321- | --------------------------- ^^^----
322- | | |
323- | | expected `usize`, found floating-point number
324- | arguments to this function are incorrect
305+ | ^^^
306+ | |
307+ | expected `usize`, found floating-point number
308+ | arguments to this function are incorrect
325309 |
326310 = note: expected reference `&usize`
327311 found reference `&{float}`
@@ -336,10 +320,10 @@ error[E0308]: mismatched types
336320 --> $DIR/ifmt-bad-arg.rs:81:35
337321 |
338322LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
339- | ------------------------------ ^^^----
340- | | |
341- | | expected `usize`, found floating-point number
342- | arguments to this function are incorrect
323+ | ^^^
324+ | |
325+ | expected `usize`, found floating-point number
326+ | arguments to this function are incorrect
343327 |
344328 = note: expected reference `&usize`
345329 found reference `&{float}`
0 commit comments