rust/tests/ui/parser/macro/macro-expand-to-match-arm.rs

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

16 lines
307 B
Rust
Raw Normal View History

macro_rules! arm {
($pattern:pat => $block:block) => {
$pattern => $block
};
}
fn main() {
let x = Some(1);
match x {
Some(1) => {},
arm!(None => {}), //~ NOTE macros cannot expand to match arms
//~^ ERROR unexpected `,` in pattern
_ => {},
};
}