2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2019-02-25 23:55:08 +00:00
|
|
|
|
|
|
|
#![feature(decl_macro)]
|
|
|
|
|
|
|
|
pub struct Foo {
|
|
|
|
bar: u32,
|
|
|
|
}
|
|
|
|
pub macro pattern($a:pat) {
|
|
|
|
Foo { bar: $a }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match (Foo { bar: 3 }) {
|
|
|
|
pattern!(3) => println!("Test OK"),
|
|
|
|
_ => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|