about summary refs log tree commit diff
path: root/tests/ui/inline-const/macro-with-const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/inline-const/macro-with-const.rs')
-rw-r--r--tests/ui/inline-const/macro-with-const.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/inline-const/macro-with-const.rs b/tests/ui/inline-const/macro-with-const.rs
new file mode 100644
index 00000000000..e7393166d8d
--- /dev/null
+++ b/tests/ui/inline-const/macro-with-const.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+macro_rules! exp {
+    (const $n:expr) => {
+        $n
+    };
+}
+
+macro_rules! stmt {
+    (exp $e:expr) => {
+        $e
+    };
+    (exp $($t:tt)+) => {
+        exp!($($t)+)
+    };
+}
+
+fn main() {
+    stmt!(exp const 1);
+}