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

Render all trait bounds in where clauses in rustdoc #96680

Closed
wants to merge 2 commits into from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented May 3, 2022

Split from #93803.

This PR modifies the rendering of bounds on generic parameters in rustdoc.

fn foo<T: Default, U>(x: impl Copy) where U: Clone

into

fn foo<T, U>(x: impl Copy) where T: Default, U: Clone

r? @GuillaumeGomez

@cjgillot cjgillot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 3, 2022
@rust-highfive
Copy link
Collaborator

Some changes occurred in clean/types.rs.

cc @camelid

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider,@aDotInTheVoid

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

Thanks for opening it!

So the zulip discussion about this is happening here.

@aDotInTheVoid
Copy link
Member

Regardless of what gets decided for the HTML, I think this would be great for JSON.

@Enselic
Copy link
Member

Enselic commented May 4, 2022

My public API diffing and listing tool is based on rustdoc JSON and tries to represent items the same way as the HTML, to minimize user confusion. So if we only change this in rustdoc JSON, that use case can't be fulfilled any longer. So my preference would be to keep HTML and JSON in sync in this regard.

@bors
Copy link
Contributor

bors commented May 7, 2022

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

@JohnCSimon
Copy link
Member

triage: returning to @cjgillot to address merge conflicts
@rustbot author

@rustbot rustbot 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 Jun 20, 2022
@cjgillot cjgillot 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 Jun 20, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [js-doc-test] src/test/rustdoc-js/generics-impl.rs stdout ----

error: rustdoc-js test failed!
status: exit status: 1
command: "/usr/bin/node" "/checkout/src/tools/rustdoc-js/tester.js" "--doc-folder" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-js/generics-impl" "--crate-name" "generics_impl" "--test-file" "/checkout/src/test/rustdoc-js/generics-impl.js"
Testing /checkout/src/test/rustdoc-js/generics-impl.js ... FAILED
Testing /checkout/src/test/rustdoc-js/generics-impl.js ... FAILED
[ query `Read -> u64`]==> Expected exactly 2 results but found 0 in 'others'
[ query `Read -> u64`]==> Result not found in 'others': '{"path":"generics_impl::Ddddddd","name":"eeeeeee"}'
Diff of first error:
 {
-     "path": "generics_impl::Ddddddd",
-     "name": "eeeeeee",
 }
[ query `Read -> u64`]==> Result not found in 'others': '{"path":"generics_impl::Ddddddd","name":"ggggggg"}'
Diff of first error:
 {
-     "path": "generics_impl::Ddddddd",
-     "name": "ggggggg",
------------------------------------------
stderr: none


@cjgillot
Copy link
Contributor Author

I did not follow the zulip discussions. @GuillaumeGomez is the rustdoc team interested in landing this change, or should I close the PR?

@GuillaumeGomez
Copy link
Member

There doesn't seem to have a consensus based on what I can see from the zulip discussion. :-/

@bors
Copy link
Contributor

bors commented Jun 22, 2022

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

@cjgillot
Copy link
Contributor Author

I'm closing this PR. Please don't hesitate to ping me or pick it up if the consensus evolves.

@cjgillot cjgillot closed this Jun 22, 2022
@cjgillot cjgillot deleted the unify-bounds-rustdoc branch June 22, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants