Skip to content

[WIP] resolve: Concatenate reexport chains from all crates - #161872

Closed
petrochenkov wants to merge 1 commit into
rust-lang:mainfrom
petrochenkov:rechain
Closed

petrochenkov wants to merge 1 commit into
rust-lang:mainfrom
petrochenkov:rechain

Conversation

@petrochenkov

@petrochenkov petrochenkov commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

This is needed for rustdoc, and rustdoc can technically do it by itself, but let's see if doing it in the compiler affects performance or not.

cc #81893

@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 Aug 27, 2026
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

r? @fee1-dead

rustbot has assigned @fee1-dead.
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 75 candidates
  • Random selection from 16 candidates

@petrochenkov

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 27, 2026
[WIP] resolve: Concatenate reexport chains from all crates
@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 Aug 27, 2026
@rust-bors

rust-bors Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 5bc7a63 (5bc7a638a2b58f7abb3b412cc48ebc41208dd982)
Base parent: e457a7b (e457a7b0d326d67b4322ef0d11bd715cfaeda48f)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (5bc7a63): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

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.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
0.2% [0.1%, 0.2%] 3
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 3
All ❌✅ (primary) -0.1% [-0.4%, 0.1%] 2

Max RSS (memory usage)

Results (primary 1.1%, secondary -0.1%)

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

mean range count
Regressions ❌
(primary)
2.0% [1.2%, 2.7%] 2
Regressions ❌
(secondary)
3.8% [1.6%, 8.8%] 7
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 1
Improvements ✅
(secondary)
-4.1% [-6.9%, -2.2%] 7
All ❌✅ (primary) 1.1% [-0.7%, 2.7%] 3

Cycles

Results (primary 0.3%, secondary 3.2%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
3.2% [2.0%, 4.5%] 2
Improvements ✅
(primary)
-1.7% [-1.7%, -1.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-1.7%, 2.3%] 2

Binary size

Results (secondary -0.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)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 476.343s -> 476.199s (-0.03%)
Artifact size: 402.74 MiB -> 402.76 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 27, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 28, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
…, r=petrochenkov

[rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`



Fixes #81893.

First commit comes from #161872 and it's the base I used for the fix in the second commit (which also reverts basically everything from the first commit, not sure if I should keep it...). In short, `NameResolution` only seems to have access to local reexports and to the final reexported item. So instead, we keep the information in `DeclKind` (which cannot implement `Drop` because it's part of `DeclData` which is stored in `ResolverArenas::dropless` so I kept a slice instead of a `SmallVec`. Guess how I found out? Lots of `panic`s :') ) and we use this information in `reexport_chain`.

r? @petrochenkov
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
…, r=petrochenkov

[rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`



Fixes #81893.

First commit comes from #161872 and it's the base I used for the fix in the second commit (which also reverts basically everything from the first commit, not sure if I should keep it...). In short, `NameResolution` only seems to have access to local reexports and to the final reexported item. So instead, we keep the information in `DeclKind` (which cannot implement `Drop` because it's part of `DeclData` which is stored in `ResolverArenas::dropless` so I kept a slice instead of a `SmallVec`. Guess how I found out? Lots of `panic`s :') ) and we use this information in `reexport_chain`.

r? @petrochenkov
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 16, 2026
…ient-crates, r=petrochenkov

[rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`

Fixes rust-lang#81893.

First commit comes from rust-lang#161872 and it's the base I used for the fix in the second commit (which also reverts basically everything from the first commit, not sure if I should keep it...). In short, `NameResolution` only seems to have access to local reexports and to the final reexported item. So instead, we keep the information in `DeclKind` (which cannot implement `Drop` because it's part of `DeclData` which is stored in `ResolverArenas::dropless` so I kept a slice instead of a `SmallVec`. Guess how I found out? Lots of `panic`s :') ) and we use this information in `reexport_chain`.

r? @petrochenkov
rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
Rollup merge of #162543 - GuillaumeGomez:reexport-from-transient-crates, r=petrochenkov

[rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`

Fixes #81893.

First commit comes from #161872 and it's the base I used for the fix in the second commit (which also reverts basically everything from the first commit, not sure if I should keep it...). In short, `NameResolution` only seems to have access to local reexports and to the final reexported item. So instead, we keep the information in `DeclKind` (which cannot implement `Drop` because it's part of `DeclData` which is stored in `ResolverArenas::dropless` so I kept a slice instead of a `SmallVec`. Guess how I found out? Lots of `panic`s :') ) and we use this information in `reexport_chain`.

r? @petrochenkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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