about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-10-19 04:55:31 +0000
committerMichael Goulet <michael@errs.io>2022-10-22 06:59:49 +0000
commit3d7b1f0d18a4bdb667c6244b1748136c312cc9cf (patch)
tree8c2eab6069abe6487d444644a8777c32b488bfad /src
parenteecde5850cade0c058dc12330081329b31a826c7 (diff)
downloadrust-3d7b1f0d18a4bdb667c6244b1748136c312cc9cf.tar.gz
rust-3d7b1f0d18a4bdb667c6244b1748136c312cc9cf.zip
Don't erroneously deny semicolons after closure expr within parentheses in a macro
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/parser/semi-after-closure-in-macro.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/parser/semi-after-closure-in-macro.rs b/src/test/ui/parser/semi-after-closure-in-macro.rs
new file mode 100644
index 00000000000..14efb6100b0
--- /dev/null
+++ b/src/test/ui/parser/semi-after-closure-in-macro.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+// Checks that the fix in #103222 doesn't also disqualify semicolons after
+// closures within parentheses *in macros*, where they're totally allowed.
+
+macro_rules! m {
+    (($expr:expr ; )) => {
+        $expr
+    };
+}
+
+fn main() {
+    let x = m!(( ||() ; ));
+}