syn icon indicating copy to clipboard operation
syn copied to clipboard

Error of unknown source by using #[derive] and Token!

Open uselessgoddess opened this issue 1 year ago • 0 comments

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,
    // ...
}

uselessgoddess avatar Aug 28 '22 17:08 uselessgoddess