gcc/testsuite/rust/compile/macros/mbe/macro32.rs
raw| 1 | macro_rules! s { |
| 2 | ($s:stmt) => {{}}; |
| 3 | } |
| 4 | |
| 5 | macro_rules! multi_s { |
| 6 | ($($s:stmt)+) => {{}}; |
| 7 | } |
| 8 | |
| 9 | fn main() -> i32 { |
| 10 | s!(let a = 15); |
| 11 | s!(;); // Empty statement |
| 12 | s!(let a = 15;); // { dg-error "Failed to match any rule within macro" } |
| 13 | multi_s!(let a = 15;); |
| 14 | // ^ this actually gets parsed as two statements - one LetStmt and one |
| 15 | // empty statement. This is the same behavior as rustc, which you can |
| 16 | // see using a count!() macro |
| 17 | |
| 18 | 32 |
| 19 | } |