@@ -5,10 +5,10 @@ LL | format!("{}");
5
5
| ^^
6
6
7
7
error: 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
9
9
|
10
10
LL | format!("{1}", 1);
11
- | ^^ ^
11
+ | ^
12
12
|
13
13
= note: positional arguments are zero-based
14
14
@@ -27,36 +27,32 @@ LL | format!("{} {}");
27
27
| ^^ ^^
28
28
29
29
error: 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
31
31
|
32
32
LL | format!("{0} {1}", 1);
33
- | ^^ ^
33
+ | ^
34
34
|
35
35
= note: positional arguments are zero-based
36
36
37
37
error: 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
39
39
|
40
40
LL | format!("{0} {1} {2}", 1, 2);
41
- | ^^ ^
41
+ | ^
42
42
|
43
43
= note: positional arguments are zero-based
44
44
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
47
47
|
48
48
LL | format!("{} {value} {} {}", 1, value=2);
49
- | ^^
50
- |
51
- = note: positional arguments are zero-based
49
+ | ^^ ^^ ^^ - -
52
50
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
55
53
|
56
54
LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
57
- | ^^ ^^ ^^
58
- |
59
- = note: positional arguments are zero-based
55
+ | ^^ ^^ ^^ ^^ ^^ ^^ - - -
60
56
61
57
error: multiple unused formatting arguments
62
58
--> $DIR/ifmt-bad-arg.rs:32:17
@@ -191,33 +187,26 @@ error: 4 positional arguments in format string, but there are 3 arguments
191
187
|
192
188
LL | println!("{} {:.*} {}", 1, 3.2, 4);
193
189
| ^^ ^^--^ ^^ - --- -
194
- | | |
195
- | | this parameter corresponds to the precision flag
190
+ | |
196
191
| this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
197
192
|
198
193
= note: positional arguments are zero-based
199
194
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
200
195
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
203
198
|
204
199
LL | 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
+ | ^^ ^
210
201
|
211
202
= note: positional arguments are zero-based
212
203
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
213
204
214
205
error: 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
216
207
|
217
208
LL | 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
+ | ^^
221
210
|
222
211
= note: positional arguments are zero-based
223
212
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
@@ -240,24 +229,19 @@ LL | println!("{:foo}", 1);
240
229
- `X`, which uses the `UpperHex` trait
241
230
242
231
error: 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
244
233
|
245
234
LL | 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
+ | ^ ^^ ^ ^^
250
236
|
251
237
= note: positional arguments are zero-based
252
238
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
253
239
254
240
error: 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
256
242
|
257
243
LL | println!("{foo:0$}");
258
- | ^^^^^--^
259
- | |
260
- | this width flag expects an `usize` argument at position 0, but no arguments were given
244
+ | ^^
261
245
|
262
246
= note: positional arguments are zero-based
263
247
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
@@ -318,10 +302,10 @@ error[E0308]: mismatched types
318
302
--> $DIR/ifmt-bad-arg.rs:78:32
319
303
|
320
304
LL | 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
325
309
|
326
310
= note: expected reference `&usize`
327
311
found reference `&{float}`
@@ -336,10 +320,10 @@ error[E0308]: mismatched types
336
320
--> $DIR/ifmt-bad-arg.rs:81:35
337
321
|
338
322
LL | 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
343
327
|
344
328
= note: expected reference `&usize`
345
329
found reference `&{float}`
0 commit comments