proc-macro2 icon indicating copy to clipboard operation
proc-macro2 copied to clipboard

Support for the special `$crate` identifier

Open x-hgg-x opened this issue 3 years ago • 0 comments

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 ?

x-hgg-x avatar Aug 07 '22 12:08 x-hgg-x