Skip to content

Commit

Permalink
Merge pull request #1815 from dtolnay/macrange
Browse files Browse the repository at this point in the history
Fix incorrect parse of statement macro followed by range
  • Loading branch information
dtolnay authored Dec 29, 2024
2 parents f25ddf5 + f5db50a commit ce081e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ pub(crate) mod parsing {
if ahead.peek2(Ident) || ahead.peek2(Token![try]) {
is_item_macro = true;
} else if ahead.peek2(token::Brace)
&& !(ahead.peek3(Token![.]) || ahead.peek3(Token![?]))
&& !(ahead.peek3(Token![.]) && !ahead.peek3(Token![..])
|| ahead.peek3(Token![?]))
{
input.advance_to(&ahead);
return stmt_mac(input, attrs, path).map(Stmt::Macro);
Expand Down

0 comments on commit ce081e8

Please sign in to comment.