What are the "complex technical reasons" why procedural macros must be in a separate crate?
I recently wrote my first procedural macro, and found that I had to place it in a separate crate, even though I only use it internally in my main crate. The Rust Book enigmatically states (emphasis added):
When creating procedural macros, the definitions must reside in their own crate with a special crate type. This is for complex technical reasons that we hope to eliminate in the future.
Now I'm really curious what those reasons actually are. Can anyone explain, or point me to a resource where I can learn more? In particular, I don't understand why Rust can't just "pretend" that any module containing proc macro definitions is in a crate of its own (provided it doesn't depend on other definitions from the crate), which roughly seems to be what this crate does.