Rewrite and refactor format_args!() builtin macro.

This commit is contained in:
Mara Bos 2022-08-08 16:17:08 +02:00
parent d9297d22ad
commit 9bec0de397
7 changed files with 1245 additions and 1372 deletions

View file

@ -117,20 +117,20 @@ LL | format!("{} {}", 1, 2, foo=1, bar=2);
| multiple missing formatting specifiers
error: duplicate argument named `foo`
--> $DIR/ifmt-bad-arg.rs:40:33
--> $DIR/ifmt-bad-arg.rs:40:29
|
LL | format!("{foo}", foo=1, foo=2);
| - ^ duplicate argument
| |
| previously here
| --- ^^^ duplicate argument
| |
| previously here
error: positional arguments cannot follow named arguments
--> $DIR/ifmt-bad-arg.rs:41:35
|
LL | format!("{foo} {} {}", foo=1, 2);
| - ^ positional arguments must be before named arguments
| |
| named argument
| ----- ^ positional arguments must be before named arguments
| |
| named argument
error: named argument never used
--> $DIR/ifmt-bad-arg.rs:45:51

View file

@ -22,7 +22,7 @@ error: positional arguments cannot follow named arguments
--> $DIR/format-parse-errors.rs:10:9
|
LL | foo = foo,
| --- named argument
| --------- named argument
LL | bar,
| ^^^ positional arguments must be before named arguments