mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
14 lines
264 B
Rust
14 lines
264 B
Rust
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
|
|
);
|
|
}
|