about summary refs log tree commit diff
path: root/tests/ui/macros/issue-5060.rs
blob: bca71e7e5c792089a3b2c1267b132bddc98a66bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ 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)
}