about summary refs log tree commit diff
path: root/tests/ui/macros/trace_macros-format.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/macros/trace_macros-format.rs')
-rw-r--r--tests/ui/macros/trace_macros-format.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/macros/trace_macros-format.rs b/tests/ui/macros/trace_macros-format.rs
new file mode 100644
index 00000000000..afca45ca0f2
--- /dev/null
+++ b/tests/ui/macros/trace_macros-format.rs
@@ -0,0 +1,18 @@
+#![feature(trace_macros)]
+
+fn main() {
+    trace_macros!(); //~ ERROR trace_macros! accepts only `true` or `false`
+    trace_macros!(1); //~ ERROR trace_macros! accepts only `true` or `false`
+    trace_macros!(ident); //~ ERROR trace_macros! accepts only `true` or `false`
+    trace_macros!(for); //~ ERROR trace_macros! accepts only `true` or `false`
+    trace_macros!(true,); //~ ERROR trace_macros! accepts only `true` or `false`
+    trace_macros!(false 1); //~ ERROR trace_macros! accepts only `true` or `false`
+
+
+    // should be fine:
+    macro_rules! expando {
+        ($x: ident) => { trace_macros!($x) }
+    }
+
+    expando!(true);
+}