Skip to content

Commit 2397e7a

Browse files
committed
Auto merge of #16787 - pksunkara:remove-macro-call-check, r=lnicola
Remove unncessary check for macro call Since `macro_rules` is a contextual keyword, it is an `IDENT` token and thus `is_path_start` already identifies it correctly. You can tell the previous check is unnecessary because the relevant tests still pass.
2 parents 2b7b44b + a838e44 commit 2397e7a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/parser/src/grammar/items.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ pub(super) fn item_or_macro(p: &mut Parser<'_>, stop_on_r_curly: bool) {
7070
// macro_rules! {};
7171
// macro_rules! ()
7272
// macro_rules! []
73-
let no_ident = p.at_contextual_kw(T![macro_rules]) && p.nth_at(1, BANG) && !p.nth_at(2, IDENT);
74-
if paths::is_use_path_start(p) || no_ident {
73+
if paths::is_use_path_start(p) {
7574
macro_call(p, m);
7675
return;
7776
}

0 commit comments

Comments
 (0)