proc-macro2
proc-macro2 copied to clipboard
Support for the special `$crate` identifier
In my custom-format crate, I pass the special $crate identifier from a declarative macro to a procedural macro, which allows me to avoid using a crate such as proc-macro-crate. This identifier cannot be created with the Ident::new method, so the procedural macro cannot be tested with real inputs using the proc_macro2 crate.
Is it acceptable to extend this crate to allow constructing the $crate identifier via
proc_macro2::Ident::new("$crate", Span::call_site())
instead of panicking ?