mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
25 lines
382 B
Rust
25 lines
382 B
Rust
// Ensure macro metavariables are not compared without removing transparent
|
|
// marks.
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
// run-pass
|
|
|
|
#[rustc_macro_transparency = "transparent"]
|
|
macro_rules! k {
|
|
($($s:tt)*) => {
|
|
macro_rules! m {
|
|
($y:tt) => {
|
|
$($s)*
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
k!(1 + $y);
|
|
|
|
fn main() {
|
|
let x = 2;
|
|
assert_eq!(3, m!(x));
|
|
}
|