diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-04-24 16:45:29 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-04-24 16:45:29 -0700 |
| commit | 0e505d427a573de2b1ba9d493171c2da0df9f12b (patch) | |
| tree | 2a2050a36c1310ce5d2d1f6dc605088aa21fc02d /src/libsyntax | |
| parent | e305df1846a6d985315917ae0c81b74af8b4e641 (diff) | |
| download | rust-0e505d427a573de2b1ba9d493171c2da0df9f12b.tar.gz rust-0e505d427a573de2b1ba9d493171c2da0df9f12b.zip | |
Add guard for missing comma in macro call suggestion
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/tokenstream.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs index 2d47b982ebd..93b5ecadd14 100644 --- a/src/libsyntax/tokenstream.rs +++ b/src/libsyntax/tokenstream.rs @@ -182,8 +182,10 @@ impl TokenStream { (_, (TokenTree::Token(_, token::Token::Comma), _)) => continue, ((TokenTree::Token(sp, token_left), NonJoint), (TokenTree::Token(_, token_right), _)) - if (token_left.is_ident() || token_left.is_lit()) && - (token_right.is_ident() || token_right.is_lit()) => *sp, + if ((token_left.is_ident() && !token_left.is_reserved_ident()) + || token_left.is_lit()) && + ((token_right.is_ident() && !token_right.is_reserved_ident()) + || token_right.is_lit()) => *sp, ((TokenTree::Delimited(sp, ..), NonJoint), _) => sp.entire(), _ => continue, }; |
