-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
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.
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. |
src/test/rustdoc/issue-46380-2.rs
Outdated
// @has issue_46380_2/struct.Public.html | ||
pub struct PublicStruct; | ||
|
||
// @!has - '//*[@class="impl"]' 'impl Add<Private> for Public' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Cool! r=me is travis is green. |
@bors r+ Thanks again! |
📌 Commit 5f47c7f has been approved by |
…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.
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.