about summary refs log tree commit diff
path: root/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs
blob: 69880ee7fa9aa87cd00ea5b5fda845116bc42fdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Issue: https://github.com/rust-lang/rust/issues/111904
// Ensure that a trailing `,` is not interpreted as a `0`.

#![feature(macro_metavar_expr)]

macro_rules! foo {
    ( $( $($t:ident),* );* ) => { ${count($t,)} }
    //~^ ERROR `count` followed by a comma must have an associated
    //~| ERROR expected expression, found `$`
}

fn test() {
    foo!(a, a; b, b);
}

fn main() {}