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: Clean up handling of lifetime bounds #88604

Merged
merged 2 commits into from
Sep 5, 2021

Conversation

camelid
Copy link
Member

@camelid camelid commented Sep 2, 2021

Previously, rustdoc recorded lifetime bounds by rendering them into the
name of the lifetime parameter. Now, it leaves the name as the actual
name and instead records lifetime bounds in an outlives list, similar
to how type parameter bounds are recorded.

Also, higher-ranked lifetimes cannot currently have bounds, so I simplified
the code to reflect that.

r? @GuillaumeGomez

Previously, rustdoc recorded lifetime bounds by rendering them into the
name of the lifetime parameter. Now, it leaves the name as the actual
name and instead records lifetime bounds in an `outlives` list, similar
to how type parameter bounds are recorded.
This cleans up the other spot I found where rustdoc was rendering bounds
into the lifetime name itself. However, in this case, I don't think it
could have actually happened because higher-ranked lifetime definitions
aren't currently allowed to have bounds.
@camelid camelid added A-lifetimes Area: lifetime related C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 2, 2021
@rust-highfive
Copy link
Collaborator

rustdoc-json-types is a public (although nightly-only) API. Consider changing src/librustdoc/json/conversions.rs instead; otherwise, make sure you update format_version.

cc @CraftSpider,@aDotInTheVoid

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 2, 2021
@GuillaumeGomez
Copy link
Member

You did it faster than I expected. Looks great, thanks a lot!

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 3, 2021

📌 Commit 3a3f99a has been approved by GuillaumeGomez

@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 Sep 3, 2021
@jyn514
Copy link
Member

jyn514 commented Sep 3, 2021

@bors r-

This doesn't update format-version in rustdoc-json-types. Please read the messages from highfive, I set them up for a reason.

@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 Sep 3, 2021
@jyn514
Copy link
Member

jyn514 commented Sep 3, 2021

Oh sorry, I missed https://github.com/rust-lang/rust/pull/88604/files#diff-1a2ef1ea43fd65123fdf8a158a34408aa7c31c4bdb34ce1458b7f6c22b3ab459R237. Seems weird that the format-version is in rustdoc and not in rustdoc-json-types - maybe we should change that at some point?

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Sep 3, 2021

📌 Commit 3a3f99a has been approved by GuillaumeGomez

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 3, 2021
@GuillaumeGomez
Copy link
Member

Oh sorry, I missed https://github.com/rust-lang/rust/pull/88604/files#diff-1a2ef1ea43fd65123fdf8a158a34408aa7c31c4bdb34ce1458b7f6c22b3ab459R237. Seems weird that the format-version is in rustdoc and not in rustdoc-json-types - maybe we should change that at some point?

@bors r=GuillaumeGomez

Please open an issue so we don't forget. ;)

@bors
Copy link
Contributor

bors commented Sep 5, 2021

⌛ Testing commit 3a3f99a with merge f7c00dc...

@bors
Copy link
Contributor

bors commented Sep 5, 2021

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing f7c00dc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 5, 2021
@bors bors merged commit f7c00dc into rust-lang:master Sep 5, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 5, 2021
@camelid camelid deleted the rustdoc-lifetime-bounds branch September 5, 2021 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: lifetime related C-cleanup Category: PRs that clean code up or issues documenting cleanup. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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