Skip to content

In macro expansion section, explains why import and collections must be redone #1873

Open
@Arthur-Milchior

Description

@Arthur-Milchior

In https://rustc-dev-guide.rust-lang.org/macro-expansion.html , I'd suggest adding slightly more explanations to the part 2.1 and 2.2. I can guess why they are here but I admit I'm far from certains of being right.

2.1. I would have assume that you don't need to resolve imports at each iteration; that would be wasted work. The only exception I could think of would be if, while expanding a macro, you create new imports. But in this case, 2.4.3. may even consider this case with "integrating its output"

2.2. Similarly, I'd expect that all macro invocations were collected either at step 1, or or at 2.4.3. Unless there is a difference between "unresolved macro" and "macro invocation". In which, I'd really appreciate a clarification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: macros (general sense)E-hardDifficulty: might require advanced knowledgeI-terseIssue: info is very terseT-compilerRelevant to compiler team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions