rust/tests/ui/macros/issue-44127.rs

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

18 lines
244 B
Rust
Raw Normal View History

2019-02-25 17:55:08 -06:00
// run-pass
#![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!(),
}
}