Skip to content
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

rustdoc: Collect traits in scope for foreign inherent impls #93539

Merged
merged 1 commit into from
Feb 5, 2022

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Feb 1, 2022

Inherent impls can be inlined for variety of reasons (impls of reexported types, impls available through Deref, impls inlined for unclear reasons like in #88679 (comment)).
If an impl is inlined, then doc links in its comments are resolved and we may need the set of traits that are in scope at that impl's definition point.
So in this PR we simply collect traits in scope for all inherent impls from other crates if their Self type is public, which is very similar for the strategy for trait impls previously used in #88679.

Fixes #93476
Fixes #88679 (comment)
Fixes #88679 (comment)

@rustbot rustbot added 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. labels Feb 1, 2022
@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2022
@petrochenkov
Copy link
Contributor Author

r? @camelid
@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 1, 2022
@bors
Copy link
Contributor

bors commented Feb 1, 2022

⌛ Trying commit dfbf5b3a81fdacb90d5a3dfd1e9c4a8de896b727 with merge d3dcd7b981fb43fad7a16c0dbc2f20898a0579c5...

@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2022
@bors
Copy link
Contributor

bors commented Feb 1, 2022

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

@rust-timer
Copy link
Collaborator

Queued d3dcd7b981fb43fad7a16c0dbc2f20898a0579c5 with parent 25862ff, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d3dcd7b981fb43fad7a16c0dbc2f20898a0579c5): comparison url.

Summary: This benchmark run shows 39 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 1.1%
  • Largest regression in instruction counts: 1.7% on full builds of projection-caching doc

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 2, 2022
@petrochenkov petrochenkov removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 2, 2022
@camelid
Copy link
Member

camelid commented Feb 3, 2022

The rustdoc side looks good to me, but I'd like someone else to review the metadata code. @michaelwoerister could you look at that part?

Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! To clarify, this PR does not make the compiler encode anything new in crate metadata, right? It just adds a method for retrieving something that is already there?

@petrochenkov
Copy link
Contributor Author

@michaelwoerister

To clarify, this PR does not make the compiler encode anything new in crate metadata, right? It just adds a method for retrieving something that is already there?

Yes, the method just decodes the whole table of inherent impls which is already there.

@michaelwoerister
Copy link
Member

OK, r=me then with the doc comments added.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 4, 2022
@petrochenkov
Copy link
Contributor Author

@bors r=camelid,michaelwoerister

@bors
Copy link
Contributor

bors commented Feb 4, 2022

📌 Commit afc0030 has been approved by camelid,michaelwoerister

@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 Feb 4, 2022
@bors
Copy link
Contributor

bors commented Feb 5, 2022

⌛ Testing commit afc0030 with merge f9c3bb5dfc36d618e3be59ade04586b9c86c2112...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Feb 5, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 5, 2022
@petrochenkov
Copy link
Contributor Author

@bors retry

@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 Feb 5, 2022
@bors
Copy link
Contributor

bors commented Feb 5, 2022

⌛ Testing commit afc0030 with merge 88fb06a...

@bors
Copy link
Contributor

bors commented Feb 5, 2022

☀️ Test successful - checks-actions
Approved by: camelid,michaelwoerister
Pushing 88fb06a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 5, 2022
@bors bors merged commit 88fb06a into rust-lang:master Feb 5, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 5, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (88fb06a): comparison url.

Summary: This benchmark run shows 41 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 1.1%
  • Largest regression in instruction counts: 1.7% on full builds of projection-caching doc

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@camelid
Copy link
Member

camelid commented Feb 6, 2022

@rustbot label: +perf-regression-triaged

This was necessary to fix a P-critical bug, and the regressions are relatively small.

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc ICE: 'no entry found for key'
9 participants