Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 35504ac

Browse files
authored
Merge pull request rust-lang#3500 from rchaser53/issue-3499
fix not to delete semicolon for macro with square brackets
2 parents 8ec0750 + 8ffe414 commit 35504ac

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/macros.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ pub fn rewrite_macro_inner(
274274
DelimToken::Paren if position == MacroPosition::Item => {
275275
Some(format!("{}();", macro_name))
276276
}
277+
DelimToken::Bracket if position == MacroPosition::Item => {
278+
Some(format!("{}[];", macro_name))
279+
}
277280
DelimToken::Paren => Some(format!("{}()", macro_name)),
278281
DelimToken::Bracket => Some(format!("{}[]", macro_name)),
279282
DelimToken::Brace => Some(format!("{} {{}}", macro_name)),

tests/target/issue-3499.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test![];

0 commit comments

Comments
 (0)