Closed MiSawa closed 7 months ago
Sorry for the late reply. It looks good to me.
As far as I remember, the only reason I avoided using ty matcher is to specialize vectors [T; n]
and tuples (T, U, ...)
, just as you explained. They seem to be correctly cared in the fix.
CI is failing but that's not related to this PR. I'll merge this and fix it later.
Thank you for the PR!
I noticed that we can't use generic types with two or more arguments for the
@kind
part of theinput!
macro. This is, IIUC, bacause the comma,
that separates generic arguments is treated as a comma that separates fields ininput!
macro, and thusread_value!
gets something like@kind Foo<Arg1
.To fix the issue, I had to special-case vec type
[...]
and tuple type(...)
inside theinput!
macro and fall-through toty
instead oftt*
, since once the whole[...]
/(..)
are matched toty
it can't be matched to[ tt* ]
/( tt* )
inread_value!
macro, it seems to me. (see: https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment )Disclaimer: I'm noob at macros, and not 100% confident with the change. Please read the change with a skeptical eye :pray: