Feature request: support anonymous slice element.
Closed this issue · 3 comments
crlf0710 commented
I'm trying to write a macro that put elements into a distribute_slice. One hard thing is that i have to name the individual items...
I feel it would be more convenient if using _ as the name of anonymous slice element is supported (distribute_slice(XYZ) can replace it with whatever name it feels best i think).
dtolnay commented
This would be on the language to permit static _
as valid syntax; it was decided against in rust-lang/rust#54912.
dtolnay commented
To avoid naming elements from the macro you can make your macro expand to:
const _: () = {
#[distributed_slice(...)]
static __: Type = value;
};
crlf0710 commented
OK, great to know, thanks!