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

Hide private trait type params and show hidden items with document-private #46412

Merged
merged 3 commits into from
Dec 2, 2017

Conversation

chrisduerr
Copy link
Contributor

As discussed in #46380, this PR removes the strip-hidden pass from --document-private-items which allows showing #[doc(hidden)] with rustdoc.

The second commit removes the trait implementation from the docs if the trait's parameter is private.

When using `#[doc(hidden)]` elements are hidden from docs even when the
rustdoc flag `--document-private-items` is set.

This behavior has been changed to display all hidden items when the flag
is active.
Trait's implementations with private type parameters were displayed in
the implementing struct's documentation until now.

With this change any trait implementation that uses a private type
parameter is now hidden in the docs.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @frewsxcv (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

// @has issue_46380_2/struct.Public.html
pub struct PublicStruct;

// @!has - '//*[@class="impl"]' 'impl Add<Private> for Public'
Copy link
Member

Choose a reason for hiding this comment

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

This probably needs to be 'impl PublicTrait<PrivateStruct> for PublicStruct', to actually check the right thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah totally my bad. I renamed things and then only checked that it works, not if the negative fails.

I'll test both failure and success and then push another commit.

After renaming the structs and enums the htmldocck strings still
contained the old names. This lead to test failure.

These htmldocck tests have been updated to use the proper names of the
rust structs and traits.
@QuietMisdreavus
Copy link
Member

Cool! r=me is travis is green.

@QuietMisdreavus
Copy link
Member

@bors r+

Thanks again!

@bors
Copy link
Contributor

bors commented Nov 30, 2017

📌 Commit 5f47c7f has been approved by QuietMisdreavus

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 Dec 1, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Dec 1, 2017
…reavus

Hide private trait type params and show hidden items with document-private

As discussed in rust-lang#46380, this PR removes the `strip-hidden` pass from `--document-private-items` which allows showing `#[doc(hidden)]` with rustdoc.

The second commit removes the trait implementation from the docs if the trait's parameter is private.
bors added a commit that referenced this pull request Dec 1, 2017
Rollup of 13 pull requests

- Successful merges: #45880, #46280, #46373, #46376, #46385, #46386, #46387, #46392, #46400, #46401, #46405, #46412, #46421
- Failed merges:
@bors bors merged commit 5f47c7f into rust-lang:master Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants