mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
17 lines
334 B
Rust
17 lines
334 B
Rust
// run-pass
|
|
macro_rules! print_hd_tl {
|
|
($field_hd:ident, $($field_tl:ident),+) => ({
|
|
print!("{}", stringify!($field_hd));
|
|
print!("::[");
|
|
$(
|
|
print!("{}", stringify!($field_tl));
|
|
print!(", ");
|
|
)+
|
|
print!("]\n");
|
|
})
|
|
}
|
|
|
|
pub fn main() {
|
|
print_hd_tl!(x, y, z, w)
|
|
}
|