syn
syn copied to clipboard
Error of unknown source by using #[derive] and Token!
I tried to add #[derive(Debug)]
to this struct
#[derive(Debug)]
struct Test<T> {
kw: T,
eq_token: Token![=],
// ...
}
But the compiler offends me.
error: `derive` cannot be used on items with type macros
--> src\main.rs:9:15
|
9 | eq_token: Token![=],
| ^^^^^^^^^
Besides, it works:
#[derive(Debug)]
struct Test<T> {
kw: T,
eq_token: syn::token::Eq,
// ...
}