summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hygiene/issue-40847.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/hygiene/issue-40847.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/hygiene/issue-40847.rs b/src/test/ui/hygiene/issue-40847.rs
new file mode 100644
index 000000000..087b40ad6
--- /dev/null
+++ b/src/test/ui/hygiene/issue-40847.rs
@@ -0,0 +1,17 @@
+// run-pass
+macro_rules! gen {
+ ($name:ident ( $($dol:tt $var:ident)* ) $($body:tt)*) => {
+ macro_rules! $name {
+ ($($dol $var:ident)*) => {
+ $($body)*
+ }
+ }
+ }
+}
+
+gen!(m($var) $var);
+
+fn main() {
+ let x = 1;
+ assert_eq!(m!(x), 1);
+}