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

Test rustc output blocks in src/doc/rustdoc/src/ documentation #81305

Open
joshtriplett opened this issue Jan 23, 2021 · 2 comments
Open

Test rustc output blocks in src/doc/rustdoc/src/ documentation #81305

joshtriplett opened this issue Jan 23, 2021 · 2 comments
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@joshtriplett
Copy link
Member

joshtriplett commented Jan 23, 2021

Per discussion with @jyn514 on Zulip: this and other rustdoc documentation files should have the output they contain tested. #80527 turned up a case where the output didn't match the compiler behavior.

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Jan 23, 2021
@ehuss
Copy link
Contributor

ehuss commented Jan 23, 2021

Can you clarify what you mean by "doctests"? All book examples are tested, I'm guessing you mean something like "compiletest" or lint-docs?

I think the lint-docs tool could be extended to also generate the rustdoc chapter (it currently explicitly ignores rustdoc lints), though the format would need to change somewhat and the documentation would need to move to the source code.

If you're not familiar with lint-docs, there's a tiny amount of documentation here. I realize now there aren't any high-level docs, I should probably add a README to it.

@joshtriplett
Copy link
Member Author

joshtriplett commented Jan 23, 2021

@ehuss The issue is that the output sections aren't being checked, which is why they were able to mismatch rustc's output without producing a test failure.

Updated the issue to clarify.

@joshtriplett joshtriplett changed the title Check docs in src/doc/rustdoc/src/lints.md (and similar) as doctests Test rustc output blocks in src/doc/rustdoc/src/ documentation Jan 23, 2021
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants