I suspect the answer is probably no, but want to check anyway in case there is some blackmagic I am unaware of.
I have my own procedural macro which does #[derive(FooBar)]
.
As part of macro, we march across all the named fields / unnamed fields of a struct / enum, and do different things with the (name_i, Type_i) pair.
Now, I want to have the procedural macro do different things based on whether Type_i implements some trait Animal_T.
I.e. if Type_i implements Animal_T, output one code block; otherwise output another code block.
I suspect this is impossible since procedural macros operate on the syntactical level, before type checking. However, I wanted to ask anyway in case there is some blackmagic trick.