rust/tests/ui/macros/issue-5060.rs

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

17 lines
334 B
Rust
Raw Normal View History

// run-pass
macro_rules! print_hd_tl {
($field_hd:ident, $($field_tl:ident),+) => ({
print!("{}", stringify!($field_hd));
print!("::[");
$(
print!("{}", stringify!($field_tl));
print!(", ");
)+
2015-09-20 10:35:08 +00:00
print!("]\n");
})
}
pub fn main() {
print_hd_tl!(x, y, z, w)
}