diff options
Diffstat (limited to 'tests/ui/macros/metavar-expressions/count-empty-index-arg.rs')
| -rw-r--r-- | tests/ui/macros/metavar-expressions/count-empty-index-arg.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs b/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs new file mode 100644 index 00000000000..69880ee7fa9 --- /dev/null +++ b/tests/ui/macros/metavar-expressions/count-empty-index-arg.rs @@ -0,0 +1,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() {} |
