Completing support for trailing commas in std macros (original) (raw)

I really want to see complete support for trailing commas in std macros.

As I described on Internals, all (stable) "variadic" macros correctly support trailing commas for sufficiently long argument lists. It is only a few, select, specific argument counts that trip them up.

Here is a check list of all test cases that currently fail to compile:

Failing cases that obviously need fixing

These macros already support trailing commas when given longer argument lists, they just fail for these specific lengths:

Worth discussion

These macros technically have not yet committed to the "function-call-like" syntax and we still currently have the option to extend these with an entirely different syntax. Like, I don't know, compile_error!("a" => b) or something.

Oddball cases


I offer to help with at least those macros which are implemented via macro_rules!.