rust/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs
Trevor Gross cf5eb27910 mbe: Restructure macro_metavar_expr tests
These tests have expanded beyond the RFC, so rename the directory
`rfc-3086-metavar-expr` to `metavar-expressions`. `concat` (which wasn't
part of the RFC) now fits in this group, so merge its tests into the
`metavar-expressions` directory.

Additionally rename some related `issue-*` tests.
2025-06-23 06:25:55 -05:00

17 lines
386 B
Rust

// 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() {}