Description
Procedural macros are often coupled with "runtime crates" which support the various macros that the procedural macro exports. These runtime crates, however, sometimes also want to invoke the procedural macro itself (think panic!
and libstd, which exports it for users and also defines it itself).
Let's say our runtime crate is called foo
. The macro today generally expands to paths that look like ::foo::MyType
. This doesn't work by default in the crate foo
itself, so foo
typically includes a module that looks like:
mod foo { pub use super::*; }
And the enables the crate foo
to use its own macros internally.
In the 2018 edition, however, the ::foo::MyType
path unconditionally requires foo
to be a crate, which isn't the case when we're compiling foo
! As a result, these sorts of runtime crates don't have a great path forward when migrating to the 2018 edition.