Skip to content

[rustc_resolve] Correctly keep all reexports in ModChild::reexport_chain - #162543

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
GuillaumeGomez:reexport-from-transient-crates
Sep 17, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
GuillaumeGomez:reexport-from-transient-crates

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Sep 9, 2026

Copy link
Copy Markdown
Member

View all comments

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 panics :') ) and we use this information in reexport_chain.

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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 9, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member 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 Sep 9, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
…, r=<try>

[rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`
@rust-log-analyzer

This comment has been minimized.

@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 Sep 9, 2026
@rust-bors

rust-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: ad96898 (ad96898c9ea81f133409f573e53d98a7dc5eee46)
Base parent: 55c4dfe (55c4dfed758e741620e3320ed472ff5c4140856a)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (ad96898): 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.4% [0.2%, 0.6%] 11
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) 0.4% [0.2%, 0.6%] 11

Max RSS (memory usage)

Results (primary 0.7%, secondary -2.1%)

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

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 1.1%] 3
Regressions ❌
(secondary)
4.7% [4.5%, 4.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.7% [-9.0%, -4.4%] 3
All ❌✅ (primary) 0.7% [0.4%, 1.1%] 3

Cycles

Results (primary 0.7%, secondary 0.9%)

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

mean range count
Regressions ❌
(primary)
1.0% [0.5%, 2.2%] 14
Regressions ❌
(secondary)
5.7% [4.7%, 6.7%] 2
Improvements ✅
(primary)
-0.6% [-0.7%, -0.5%] 3
Improvements ✅
(secondary)
-3.8% [-4.8%, -2.8%] 2
All ❌✅ (primary) 0.7% [-0.7%, 2.2%] 17

Binary size

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

Bootstrap: 480.775s -> 481.562s (0.16%)
Artifact size: 403.36 MiB -> 403.30 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 Sep 9, 2026
@petrochenkov petrochenkov 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 Sep 10, 2026
Comment thread compiler/rustc_resolve/src/build_reduced_graph.rs Outdated
@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 Sep 10, 2026
@GuillaumeGomez
GuillaumeGomez force-pushed the reexport-from-transient-crates branch from 5996a38 to 200b561 Compare September 10, 2026 13:47
@GuillaumeGomez

Copy link
Copy Markdown
Member 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 Sep 10, 2026
Comment thread compiler/rustc_resolve/src/lib.rs Outdated
Comment thread compiler/rustc_resolve/src/lib.rs Outdated
@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 Sep 13, 2026
@GuillaumeGomez
GuillaumeGomez force-pushed the reexport-from-transient-crates branch from 5d8fceb to cb55fc7 Compare September 15, 2026 21:31
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

All done and squashed commits. Thanks for starting it and for the reviews!

@bors r=petrochenkov

@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit cb55fc7 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 15, 2026
@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit cb55fc7 with merge 23ee25b...

Workflow: https://github.com/rust-lang/rust/actions/runs/35058393850

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
@Zalathar

Copy link
Copy Markdown
Member

@bors yield (to beta revert, which flaked out again)

@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #162765.

@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit cb55fc7 with merge 14eb5ac...

Workflow: https://github.com/rust-lang/rust/actions/runs/35059565227

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
@Zalathar

Copy link
Copy Markdown
Member

Sadly the test-x86_64-msvc-1 job seems to have stalled.

@bors yield

@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #162846.

@Zalathar

Copy link
Copy Markdown
Member

Double-check that the job should have succeeded:

@bors try jobs=test-x86_64-msvc-1

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
…, r=<try>

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


try-job: test-x86_64-msvc-1
@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6dee990 (6dee99007bfef1d1efdf36005d271ad41e990f13)
Base parent: 28e8a8c (28e8a8c81bf3b37909edac6c2a76e56f30cd492f)

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors rollup=iffy
Making a rollup of perf-sensitive PRs

rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
…uwer

Rollup of 4 perf-sensitive pull requests

Successful merges:

 - #162450 (Cache block seeking results for initialized_at_terminator and _exit)
 - #162543 ([rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`)
 - #162712 (perf: Keep the first macro syntax-context mapping inline)
 - #162747 (Lowering cleanups)
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
…uwer

Rollup of 4 perf-sensitive pull requests

Successful merges:

 - #162450 (Cache block seeking results for initialized_at_terminator and _exit)
 - #162543 ([rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`)
 - #162712 (perf: Keep the first macro syntax-context mapping inline)
 - #162747 (Lowering cleanups)
rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
…uwer

Rollup of 4 perf-sensitive pull requests

Successful merges:

 - #162450 (Cache block seeking results for initialized_at_terminator and _exit)
 - #162543 ([rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`)
 - #162712 (perf: Keep the first macro syntax-context mapping inline)
 - #162747 (Lowering cleanups)
rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
…uwer

Rollup of 4 perf-sensitive pull requests



Successful merges:

 - #162450 (Cache block seeking results for initialized_at_terminator and _exit)
 - #162543 ([rustc_resolve]  Correctly keep all reexports in `ModChild::reexport_chain`)
 - #162712 (perf: Keep the first macro syntax-context mapping inline)
 - #162747 (Lowering cleanups)
@rust-bors
rust-bors Bot merged commit ef0d430 into rust-lang:main Sep 17, 2026
14 of 15 checks passed
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
@rustbot rustbot added this to the 1.100.0 milestone Sep 17, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (a289e4f): comparison URL.

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

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.4% [0.2%, 0.8%] 11
Regressions ❌
(secondary)
0.4% [0.3%, 0.7%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 3
All ❌✅ (primary) 0.4% [0.2%, 0.8%] 11

Max RSS (memory usage)

Results (primary -0.2%, secondary -1.6%)

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

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
3.4% [1.0%, 5.2%] 3
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
-4.7% [-5.5%, -4.1%] 5
All ❌✅ (primary) -0.2% [-2.4%, 2.0%] 2

Cycles

Results (primary 2.1%)

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

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

Binary size

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

Bootstrap: missing data
Artifact size: 406.75 MiB -> 408.73 MiB (0.49%)

@GuillaumeGomez
GuillaumeGomez deleted the reexport-from-transient-crates branch September 17, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation of a re-export doesn't appear on level-two re-export

7 participants