diff options
Diffstat (limited to 'tests/ui/macros/macro-parameter-span.rs')
-rw-r--r-- | tests/ui/macros/macro-parameter-span.rs | 13 |
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 000000000..5609f84e1 --- /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 + ); +} |