Considering the following code:
macro_rules! inner {
($(<$($ty:path : $bound:path),*> $struct:path),*) => {
$(
impl<$($ty : $bound),*> Blanket for $struct {}
)*
}
}
inner! {
<T1: Bound, T2: Bound> Pair<T1, T2>
}
// how is it expected to work:
trait Bound {}
trait Blanket {}
struct Pair<T1, T2>(std::marker::PhantomData<(T1, T2)>)
// then, the macro will do
// impl<T1: Bound, T2: Bound> Blanket for Patr<T1, T2>
Errors:
error: expected one of `!`, `+`, `>`, or `as`, found `:`
--> src/lib.rs:4:24
|
4 | impl<$($ty : $bound),*> Inner for $struct {}
| ^ expected one of `!`, `+`, `>`, or `as` here
...
8 | / inner! {
9 | | <T1: Bound, T2: Bound> Pair<T1, T2>
10 | | }
| |_- in this macro invocation
The error simply doesn't make sense for me. What this could mean?