rust/tests/ui/macros/macro-stmt_macro_in_expr_macro.rs

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

22 lines
266 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
macro_rules! foo {
() => {
struct Bar;
struct Baz;
}
}
macro_rules! grault {
() => {{
foo!();
struct Xyzzy;
0
}}
}
fn main() {
let x = grault!();
assert_eq!(x, 0);
}