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: render generic params & where-clauses of cross-crate assoc tys in impls #112920

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

fmease
Copy link
Member

@fmease fmease commented Jun 22, 2023

We used to only ever render generic parameters & where-clauses of cross-crate associated types when the item was located inside of a trait and we used to just drop them when it was inside of an impl block (trait or inherent).

Fixes #112904.

@rustbot label A-cross-crate-reexports

@rustbot
Copy link
Collaborator

rustbot commented Jun 22, 2023

r? @jsha

(rustbot has picked a reviewer for you, use r? to override)

@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. A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate labels Jun 22, 2023
@bors
Copy link
Contributor

bors commented Jun 24, 2023

☔ The latest upstream changes (presumably #112974) made this pull request unmergeable. Please resolve the merge conflicts.

@fmease fmease force-pushed the rustdoc-fix-112904 branch from b3053b7 to c643bed Compare June 24, 2023 10:21
@fmease
Copy link
Member Author

fmease commented Jun 24, 2023

Note to reviewers: The diff looks unnecessarily complex (split diff is slightly better). Basically I just moved the code responsible for obtaining the generics and the predicates (for the where-clause) out of the TraitContainer branch as alluded to in the PR description allowing us to access them in the ImplContainer branch.

Apart from that, I've added an extra TraitContainer branch that makes sure we don't try to obtain item_bounds inside an ImplContainer which would be incorrect (it'd lead to an ICE if we tried btw). See the test files for more context about that.

(I've also changed the indentation of the if/let-chains found in the code block I've moved since it didn't align with the style guide (rustfmt cannot handle them yet) and it started to annoy me. I originally wrote that part of the code. If you are wondering, it doesn't make the diff worse)

@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 26, 2023

📌 Commit c643bed has been approved by GuillaumeGomez

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 Jun 26, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2023
Rollup of 2 pull requests

Successful merges:

 - rust-lang#112677 (remove unused field)
 - rust-lang#112920 (rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jun 26, 2023

☔ The latest upstream changes (presumably #113057) made this pull request unmergeable. Please resolve the merge conflicts.

@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 Jun 26, 2023
@bors bors merged commit 40e3fcf into rust-lang:master Jun 27, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 27, 2023
@fmease fmease deleted the rustdoc-fix-112904 branch June 27, 2023 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate 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.

rustdoc doesn't render generic params & where-clauses of cross-crate GATs in certain sections
5 participants