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
335 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 18:35:08 +08:00
print!("]\n");
})
}
pub fn main() {
print_hd_tl!(x, y, z, w)
}