Skip to content

Resolver: refact macro map into external and local maps #143657

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

Merged
merged 2 commits into from
Jul 10, 2025

Conversation

LorrensP-2158466
Copy link
Contributor

Puts MacroData inside of the ResolverArena and splits macro_map into 2 maps: local_macro_map and external_macro_map. This way get_macro_by_def_id can take a &Resolver instead of a mutable one.

Part of #gsoc > Project: Parallel Macro Expansion

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 8, 2025
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 9, 2025
@petrochenkov
Copy link
Contributor

This looks ready, r=me after squashing into two commits, one for MacroRulesScopeRef and another for everything else.
(Also @rustbot ready can be used to send a PR back to review when ready.)

@LorrensP-2158466
Copy link
Contributor Author

LorrensP-2158466 commented Jul 9, 2025

Oh yeah, I forgot it because you were so quick with the responses (and because I had to head out :) ).

@LorrensP-2158466
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 9, 2025
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 10, 2025

📌 Commit e566783 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2025
bors added a commit that referenced this pull request Jul 10, 2025
Rollup of 12 pull requests

Successful merges:

 - #136906 (Add checking for unnecessary delims in closure body)
 - #143652 (docs: document trait upcasting rules in `Unsize` trait)
 - #143657 (Resolver: refact macro map into external and local maps)
 - #143659 (Use "Innermost" & "Outermost" terminology for `AttributeOrder`)
 - #143663 (fix: correct typo in attr_parsing_previously_accepted message key)
 - #143666 (Re-expose nested bodies in rustc_borrowck::consumers)
 - #143668 (Fix VxWorks build errors)
 - #143670 (Add a new maintainer to the wasm32-wasip1 target)
 - #143675 (improve lint doc text)
 - #143683 (Assorted `run-make-support` maintenance)
 - #143695 (Auto-add `S-waiting-on-author` when the PR is/switches to draft state)
 - #143706 (triagebot.toml: ping lolbinarycat if tidy extra checks were modified)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f587784 into rust-lang:master Jul 10, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 10, 2025
rust-timer added a commit that referenced this pull request Jul 10, 2025
Rollup merge of #143657 - LorrensP-2158466:split-macro-map, r=petrochenkov

Resolver: refact macro map into external and local maps

Puts `MacroData` inside of the `ResolverArena` and splits `macro_map` into 2 maps: `local_macro_map` and `external_macro_map`. This way `get_macro_by_def_id` can take a `&Resolver` instead of a mutable one.

Part of [#gsoc > Project: Parallel Macro Expansion](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/with/516965603)

r? `@petrochenkov`
@Kobzol
Copy link
Member

Kobzol commented Jul 10, 2025

@rust-timer build c212528

Checking for #143731.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c212528): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.1%, secondary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [2.1%, 6.1%] 5
Improvements ✅
(primary)
-2.1% [-3.1%, -1.0%] 2
Improvements ✅
(secondary)
-4.8% [-6.0%, -3.5%] 3
All ❌✅ (primary) -2.1% [-3.1%, -1.0%] 2

Cycles

Results (secondary -3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 463.013s -> 463.712s (0.15%)
Artifact size: 374.51 MiB -> 374.50 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants