mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
22 lines
265 B
Rust
22 lines
265 B
Rust
// 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);
|
|
}
|