rust/src/test/ui/macros/missing-comma.stderr
Esteban Küber f4039affa3 Suggest comma when missing in macro call
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.
2018-08-07 22:31:57 -07:00

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