Skip to content

resolve: Introduce (Local,Extern)Module newtypes for local and external modules respectively#155242

Open
petrochenkov wants to merge 1 commit intorust-lang:mainfrom
petrochenkov:modmodmod
Open

resolve: Introduce (Local,Extern)Module newtypes for local and external modules respectively#155242
petrochenkov wants to merge 1 commit intorust-lang:mainfrom
petrochenkov:modmodmod

Conversation

@petrochenkov
Copy link
Copy Markdown
Contributor

@petrochenkov petrochenkov commented Apr 13, 2026

Right now both LocalModule and ExternModule refer to the same ModuleData, but the module data for local and extern modules can potentially be made quite different, and we can specialize name lookup for both cases as an optimization.

Declaration creation for local and external modules was already specialized as a part of the parallel import resolution work (see define_local and define_extern, #145108 and previous PRs), because they have different properties with regards to ownership and synchronization.

@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 Apr 13, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 13, 2026

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

@petrochenkov
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 13, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 13, 2026
resolve: Introduce `(Local,Extern)Module` newtypes for local and external modules respectively
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 13, 2026

☀️ Try build successful (CI)
Build commit: 64fb35f (64fb35fbcee90871be9b0d2edc78438c95622fdf, parent: 14196dbfa3eb7c30195251eac092b1b86c8a2d84)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (64fb35f): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (primary 5.1%, secondary 9.8%)

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

mean range count
Regressions ❌
(primary)
8.8% [4.8%, 11.4%] 6
Regressions ❌
(secondary)
15.8% [4.8%, 26.9%] 2
Improvements ✅
(primary)
-2.2% [-2.8%, -1.5%] 3
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) 5.1% [-2.8%, 11.4%] 9

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 491.114s -> 489.595s (-0.31%)
Artifact size: 394.23 MiB -> 394.31 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants