about summary refs log tree commit diff
path: root/crates/parser
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2023-08-05 20:00:33 +0200
committerLukas Wirth <lukastw97@gmail.com>2023-08-05 20:00:37 +0200
commit042be329a7f09ba6b5e7901c59dee044723b9670 (patch)
tree548eab9abfaca36b85124751d33bb4c31c725199 /crates/parser
parentc59bd2dc3f05692f92b5b1c76f3d08d116e63422 (diff)
downloadrust-042be329a7f09ba6b5e7901c59dee044723b9670.tar.gz
rust-042be329a7f09ba6b5e7901c59dee044723b9670.zip
Turn unresolved proc macro expansions into missing expressions
Diffstat (limited to 'crates/parser')
-rw-r--r--crates/parser/src/grammar/items.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
index 1c056819f4b..4e850b1f74d 100644
--- a/crates/parser/src/grammar/items.rs
+++ b/crates/parser/src/grammar/items.rs
@@ -328,9 +328,6 @@ fn macro_rules(p: &mut Parser<'_>, m: Marker) {
     p.bump_remap(T![macro_rules]);
     p.expect(T![!]);
 
-    if p.at(IDENT) {
-        name(p);
-    }
     // Special-case `macro_rules! try`.
     // This is a hack until we do proper edition support
 
@@ -340,6 +337,8 @@ fn macro_rules(p: &mut Parser<'_>, m: Marker) {
         let m = p.start();
         p.bump_remap(IDENT);
         m.complete(p, NAME);
+    } else {
+        name(p);
     }
 
     match p.current() {