about summary refs log tree commit diff
path: root/tests/ui/macros/macro-parameter-span.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/macros/macro-parameter-span.rs')
-rw-r--r--tests/ui/macros/macro-parameter-span.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/macros/macro-parameter-span.rs b/tests/ui/macros/macro-parameter-span.rs
new file mode 100644
index 00000000000..5609f84e141
--- /dev/null
+++ b/tests/ui/macros/macro-parameter-span.rs
@@ -0,0 +1,13 @@
+macro_rules! foo {
+    ($id: ident) => {
+        $id
+    }
+}
+
+// Testing that the error span points to the parameter 'x' in the callsite,
+// not to the macro variable '$id'
+fn main() {
+    foo!(
+        x //~ ERROR cannot find value `x` in this scope
+        );
+}