libproc_macro: get crate for span or support $crate metavar in quote!{} #49797
Labels
A-decl-macros-1-2
Area: Declarative macros 1.2
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
One Reddit user was asking how to reference the invoking crate in a proc-macro, suggesting that
quote!{}
should support the$crate
metavar. I don't think this is too unreasonable since$
is already used for unquoting variables butcrate
couldn't be a user variable since it's a keyword.Alternately, I think
Span
could have a method telling us what crate it comes from as aString
.cc @alexcrichton @dtolnay
The text was updated successfully, but these errors were encountered: