rust/tests/ui/hygiene/issue-40847.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
297 B
Rust
Raw Normal View History

// run-pass
macro_rules! gen {
($name:ident ( $($dol:tt $var:ident)* ) $($body:tt)*) => {
macro_rules! $name {
($($dol $var:ident)*) => {
$($body)*
}
}
}
}
gen!(m($var) $var);
fn main() {
let x = 1;
assert_eq!(m!(x), 1);
}