I have written a proc macro for a project of mine. The generated code by this proc-macro uses the full path to identify an item (eg.
Path::To::My::Item instead of hoping that
Item is in scope). However, if
Path is the name of the current crate, I cannot use this proc macro! Code in the crate
Path can only refer to it via
crate. However, I cannot change
crate because I also intend to use this proc-macro in other crates.
As a workaround I added
use crate as Path to every file in the
Path crate that uses my proc-macro, but this is terrible.
I guess there is an easy and obvious solution, but I could not find anything.