Skip to content

Only add non local items to RustdocEffectiveVisibilities::extern_public #116579

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

Conversation

GuillaumeGomez
Copy link
Member

While working on #115480, I was finally able to track down the origin of the bug, still working on the fix (how to determine if a foreign trait is publically exported from the current crate in short), which led me to this small PR. It should only list foreign items and yet we don't check if they're locals before adding them to the map.

I expect a very minimal perf improvement.

r? @notriddle

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 9, 2023
@GuillaumeGomez
Copy link
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 Oct 9, 2023
@bors
Copy link
Collaborator

bors commented Oct 9, 2023

⌛ Trying commit 9d214fc with merge aa06a90...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 9, 2023
…list, r=<try>

Only add non local items to `RustdocEffectiveVisibilities::extern_public`

While working on rust-lang#115480, I was finally able to track down the origin of the bug, still working on the fix (how to determine if a foreign trait is publically exported from the current crate in short), which led me to this small PR. It should only list foreign items and yet we don't check if they're locals before adding them to the map.

I expect a very minimal perf improvement.

r? `@notriddle`
@bors
Copy link
Collaborator

bors commented Oct 9, 2023

☀️ Try build successful - checks-actions
Build commit: aa06a90 (aa06a90e8ca50e0cfed6359239dbdd58ddc94239)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (aa06a90): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to 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

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.5% [2.0%, 3.8%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 627.383s -> 625.907s (-0.24%)
Artifact size: 270.83 MiB -> 270.85 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 9, 2023
@notriddle
Copy link
Contributor

There was no significant change in perf at all, but since the data structure is supposed to only contain external public reexports, this seems better anyway.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 10, 2023

📌 Commit 9d214fc has been approved by notriddle

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 Oct 10, 2023
@petrochenkov
Copy link
Contributor

How is this possible?
There's an assert in fn lib_embargo_visit_item making sure that local items cannot get into this visitor.
Also there's no test with a reproduction in this PR.
Are you sure you are not misinterpreting something?

@petrochenkov
Copy link
Contributor

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 10, 2023
@petrochenkov petrochenkov self-assigned this Oct 10, 2023
@GuillaumeGomez
Copy link
Member Author

I might have indeed. The fact that there is no perf change is proof of that. Good catch @petrochenkov !

@GuillaumeGomez GuillaumeGomez deleted the rm-local-from-extern-list branch October 10, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants