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

Convert from proc_macro2::Span to proc_macro::Span without panic

Open TedDriggs opened this issue 2 years ago • 0 comments

Right now, it looks like proc_macro2::Span::unwrap is the only way to get a proc_macro::Span, but that will panic if it's called outside a proc macro. Could there be a TryFrom/TryInto impl, or a method that returns Option<proc_macro::Span>?

TedDriggs avatar Mar 08 '23 21:03 TedDriggs