Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Arthur-Milchior opened this issue Jan 28, 2024 · 0 comments
Labels
A-macros Area: macros (general sense) E-hard Difficulty: might require advanced knowledge I-terse Issue: info is very terse T-compiler Relevant to compiler team

Comments

@Arthur-Milchior
Copy link
Contributor

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.

@jieyouxu jieyouxu added T-compiler Relevant to compiler team A-macros Area: macros (general sense) I-terse Issue: info is very terse E-hard Difficulty: might require advanced knowledge labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: macros (general sense) E-hard Difficulty: might require advanced knowledge I-terse Issue: info is very terse T-compiler Relevant to compiler team
Projects
None yet
Development

No branches or pull requests

2 participants