Description
This is a tracking issue for making proc_macro
usable in all crates, not just those with crate type proc-macro
. Advantages:
- Simplified testing of procedural macros
- Examples in the API docs can get checked or run. Development of
proc_macro
would probably get a bit easier in general - Fewer crates would need a dependency on
proc_macro2
, which exists to solve these problems - This would be a step toward same-crate proc macros, if we ever decide we want them
proc_macro2
does this by selecting between the actual bridge implementation and a fallback, https://github.com/dtolnay/proc-macro2/blob/9c1d3eb1b6bddc5b86522bf3af98c2fb3de8e30a/src/lib.rs#L154-L158.
Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/404510-wg-macros/topic/Using.20proc_macro.20outside.20of.20proc.20macro.20crates (also some around https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Future.20macro.20possibilities.20.28e.2Eg.2E.20inline.20procedural.20macros.2E.2E.2E/near/472781328)
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- ACP Make
proc_macro
available outside procedural macro generation libs-team#406 - Implementation
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
ACP is not yet complete, design work needed