about summary refs log tree commit diff
diff options
context:
space:
mode:
authorrchaser53 <tayoshizawa29@gmail.com>2019-04-07 12:31:57 +0900
committerrchaser53 <tayoshizawa29@gmail.com>2019-04-07 12:31:57 +0900
commit8ffe4146cc813c32bee479c4640e22fdbfcaf657 (patch)
tree3846398ad616b6ba5aa8097ac8d51c0d87bc7488
parent8ec0750bb88dfe84ca2d54ddc29b13f5900641d6 (diff)
downloadrust-8ffe4146cc813c32bee479c4640e22fdbfcaf657.tar.gz
rust-8ffe4146cc813c32bee479c4640e22fdbfcaf657.zip
fix not to delete semicolon
-rw-r--r--src/macros.rs3
-rw-r--r--tests/target/issue-3499.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/macros.rs b/src/macros.rs
index 088b3e4490f..42dd8c344ee 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -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)),
diff --git a/tests/target/issue-3499.rs b/tests/target/issue-3499.rs
new file mode 100644
index 00000000000..88fd7f7e165
--- /dev/null
+++ b/tests/target/issue-3499.rs
@@ -0,0 +1 @@
+test![];