Rewrite and refactor format_args!() builtin macro.
This commit is contained in:
parent
d9297d22ad
commit
9bec0de397
7 changed files with 1245 additions and 1372 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue