Skip to content

Crates can't migrate to 2018 edition when they invoke coupled procedural macros #54647

Closed
@alexcrichton

Description

@alexcrichton

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.

Metadata

Metadata

Assignees

Labels

A-edition-2018Area: The 2018 editionF-rust_2018_preview`#![feature(rust_2018_preview)]`WG-epochWorking group: Epoch (2018) management

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions