Skip to content

libproc_macro: get crate for span or support $crate metavar in quote!{} #49797

Open

Description

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 but crate 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 a String.

cc @alexcrichton @dtolnay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-macros-1.2Area: Declarative macros 1.2C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions