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

CI tests running rustdoc with --document-private-items --document-hidden-items on std? #87844

Closed
steffahn opened this issue Aug 7, 2021 · 4 comments · Fixed by #105794
Closed
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@steffahn
Copy link
Member

steffahn commented Aug 7, 2021

I recently broke the command RUSTDOCFLAGS='--document-private-items --document-hidden-items' x doc library/std, see #87842, which demonstrates that CI doesn’t test rustdoc on the standard library with these flags. In effect, code with broken intra doc links in or other issues with doc(hidden) items (and probably also for private items?) aren’t detected and can be merged into master. Maybe we want to add a test for it? Possibly it’s even true that normal x doc library/std will always succeed if the one with --document-private-items --document-hidden-items does so we wouldn’t even need to test both with and without those flags? (Correct me if I’m wrong on that last point.)

@rustbot label T-infra, A-docs, A-testsuite, C-enhancement

@rustbot rustbot added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 7, 2021
@jyn514
Copy link
Member

jyn514 commented Aug 7, 2021

@steffahn it seems weird that we'd support this - why would you run document-hidden-items at all?

@steffahn steffahn changed the title Test running rustdoc with --document-private-items --document-hidden-items on std in CI CI tests running rustdoc with --document-private-items --document-hidden-items on std? Aug 7, 2021
@steffahn
Copy link
Member Author

steffahn commented Aug 7, 2021

why would you run document-hidden-items at all?

@jyn514 Because it’s super useful when you’re trying to understand implementation details. I’ve recently been contributing on specializations of iterators involving traits like TrustedRandomAccess which is public but doc(hidden). The broken link intra doc link actually hindered my progress reviewing a PR for a few hours until I realized that I could add -Arustdoc::broken-intra-doc-links. But in any case, it’s mostly just an argument of: Hidden items can and do have doc comments and it can be useful to render them (with --document-private-items), so why shouldn’t we make sure to keep them working?

Note that the PR mentioned in #87842 didn’t even modify the comment in question that got broken but instead just modified code in the module and with the effect of subsequently removing an import, in turn breaking the hidden doc comments. It’s hard to consistently keep those doc comments clean/working without an automated test, IMO.

@jyn514
Copy link
Member

jyn514 commented Aug 7, 2021

Gotcha - this seems reasonable to me, but it couldn't replace building without those flags because they're not actually tested, x.py just builds them directly for upload to static.rlo. But it should be pretty cheap to run it twice since it's just the libraries.

@jyn514
Copy link
Member

jyn514 commented Dec 14, 2022

Mentoring instructions: looks like @ChrisDenton already added --document-private-items, so we just need to add --document-hidden-items to this command and we can close the issue :)

RUSTDOCFLAGS="--document-private-items" python3 ../x.py doc --stage 0 library/test && \

@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Dec 14, 2022
@bors bors closed this as completed in fde3000 Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants