f4039affa3
When missing a comma in a macro call, suggest it, regardless of position. When a macro call doesn't match any of the patterns, check if the call's token stream could be missing a comma between two idents, and if so, create a new token stream containing the comma and try to match against the macro patterns. If successful, emit the suggestion.
39 lines
877 B
Plaintext
39 lines
877 B
Plaintext
error: expected token: `,`
|
|
--> $DIR/missing-comma.rs:20:19
|
|
|
|
|
LL | println!("{}" a);
|
|
| ^
|
|
|
|
error: no rules expected the token `b`
|
|
--> $DIR/missing-comma.rs:22:12
|
|
|
|
|
LL | foo!(a b);
|
|
| -^
|
|
| |
|
|
| help: missing comma here
|
|
|
|
error: no rules expected the token `e`
|
|
--> $DIR/missing-comma.rs:24:21
|
|
|
|
|
LL | foo!(a, b, c, d e);
|
|
| -^
|
|
| |
|
|
| help: missing comma here
|
|
|
|
error: no rules expected the token `d`
|
|
--> $DIR/missing-comma.rs:26:18
|
|
|
|
|
LL | foo!(a, b, c d, e);
|
|
| -^
|
|
| |
|
|
| help: missing comma here
|
|
|
|
error: no rules expected the token `d`
|
|
--> $DIR/missing-comma.rs:28:18
|
|
|
|
|
LL | foo!(a, b, c d e);
|
|
| ^
|
|
|
|
error: aborting due to 5 previous errors
|
|
|