Skip to content

Properly handle cross-crate SyntaxContext::root and ExpnId::root #85708

Open
@Aaron1011

Description

@Aaron1011

I've started a discussion on Zulip (https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Cross.20crate-hygiene.20roots) - there are some unresolved questions about how we want the general solution ('correct' cross-crate decoding of and ) to work. However, it should be possible to make a hack that just fixes the problems for macros: when we're checking the span of a token for a foreign macro, fall back to the edition of that foreign crate if the is .

Originally posted by @Aaron1011 in #84429 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-metadataArea: Crate metadataT-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