Skip to content

Commit

Permalink
Merge pull request rust-lang#3500 from rchaser53/issue-3499
Browse files Browse the repository at this point in the history
fix not to delete semicolon for macro with square brackets
  • Loading branch information
scampi authored Apr 9, 2019
2 parents 8ec0750 + 8ffe414 commit 35504ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ pub fn rewrite_macro_inner(
DelimToken::Paren if position == MacroPosition::Item => {
Some(format!("{}();", macro_name))
}
DelimToken::Bracket if position == MacroPosition::Item => {
Some(format!("{}[];", macro_name))
}
DelimToken::Paren => Some(format!("{}()", macro_name)),
DelimToken::Bracket => Some(format!("{}[]", macro_name)),
DelimToken::Brace => Some(format!("{} {{}}", macro_name)),
Expand Down
1 change: 1 addition & 0 deletions tests/target/issue-3499.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test![];

0 comments on commit 35504ac

Please # to comment.