aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/braced_macro_statements2.rs
blob: e7b6ab381027498c8df71a10250e1aaeeb239b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Output of statement macros is always parsed as a statement, so no semicolon
// is needed on the inner macro.

macro_rules! m {
    (macro) => { m!(stmts) };
    (stmts) => { let x = 3; x - 3 }
}

fn foo() -> i32 {
    m!{macro}
}

fn main() -> i32 {
    foo()
}