Why do proc-macros have to be defined in proc-macro crate?
问题 I was trying to create a derive macro for my trait, to simplify some stuff. I've encountered some problems: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type and, after the small fix proc-macro=true : proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently functions tagged with `#[proc_macro_derive]` must currently reside in the root of the crate` What is the reason for this behaviour? 回答1: