proc-macro2
proc-macro2 copied to clipboard
Convert from proc_macro2::Span to proc_macro::Span without panic
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>?