Add cargo new
flag for inserting proc-macro = true
into Cargo.toml
#14708
Labels
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-new
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Problem
I'm currently in the process of creating a presentation about how to implement derive macros. I found that I could express the process of creating the proc macro subcrate and adding the proper dependencies via a snippet of shell commands:
cargo new my_macros --lib cargo add my_macros --path my_macros cd my_macros cargo add syn cargo add quote cargo add proc_macro2
There is one notable exception here: I cannot write a command that adds the proper tag to the manifest.
Proposed Solution
It would be nice for feature parity with the
--lib
specification to have a CLI flag for emitting the manifest for a proc macro crate. I suspect this would be a relatively simple thing to add as well, and I am happy to work on it myself if this issue gets approved.Specifically, I propose that
cargo new
have a--proc-macro
flag that is mutually exclusive with--bin
or--lib
(to my understanding it would only be valid in the case of library crate anyway, though feel free to correct me here).Notes
No response
The text was updated successfully, but these errors were encountered: