summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-04-24 16:45:29 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-04-24 16:45:29 -0700
commit0e505d427a573de2b1ba9d493171c2da0df9f12b (patch)
tree2a2050a36c1310ce5d2d1f6dc605088aa21fc02d /src/libsyntax
parente305df1846a6d985315917ae0c81b74af8b4e641 (diff)
downloadrust-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.rs6
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,
                     };