Stream: rustdoc

Topic: Testing lints for rustdoc


view this post on Zulip Poliorcetics (Dec 12 2020 at 01:33):

I'll go to sleep very soon so this is not urgent in any way but I'll want to write tests for https://github.com/rust-lang/rust/pull/79816 next and I don't know where and how lints are tested for rustdoc

view this post on Zulip Poliorcetics (Dec 12 2020 at 01:33):

Where can I find the information/an example ?

view this post on Zulip Joshua Nelson (Dec 12 2020 at 01:34):

probably somewhere in src/test/rustdoc-ui? this part of rustdoc isn't tested well

view this post on Zulip Joshua Nelson (Dec 12 2020 at 01:35):

yeah this looks about right:

$ ls ~/rustc/src/test/rustdoc-ui/*lint*
/home/joshua/rustc/src/test/rustdoc-ui/lint-group.rs
/home/joshua/rustc/src/test/rustdoc-ui/lint-group.stderr
/home/joshua/rustc/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
/home/joshua/rustc/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr
/home/joshua/rustc/src/test/rustdoc-ui/no-crate-level-doc-lint.rs
/home/joshua/rustc/src/test/rustdoc-ui/no-crate-level-doc-lint.stderr
/home/joshua/rustc/src/test/rustdoc-ui/pub-export-lint.rs
/home/joshua/rustc/src/test/rustdoc-ui/pub-export-lint.stderr
/home/joshua/rustc/src/test/rustdoc-ui/unknown-renamed-lints.rs
/home/joshua/rustc/src/test/rustdoc-ui/unknown-renamed-lints.stderr
/home/joshua/rustc/src/test/rustdoc-ui/unused-braces-lint.rs

view this post on Zulip Joshua Nelson (Dec 12 2020 at 01:36):

wow github's ui is so bad sometimes - I typed r? @jyn514 and hit tab by reflex and it changed it to r? @poliorcetics lmao

view this post on Zulip Joshua Nelson (Dec 12 2020 at 01:45):

left a review

view this post on Zulip GuillaumeGomez (Dec 12 2020 at 12:51):

The problem is that rustdoc initially didn't use the compiler error system, I added it "recently" (a year ago? Maybe more? No idea) and didn't update all errors yet

view this post on Zulip GuillaumeGomez (Dec 12 2020 at 12:52):

but at least, the errors using the "new" error system are all tested, and if more are added/updated to this error system, we'll need to test them all as well :)

view this post on Zulip Joshua Nelson (Dec 12 2020 at 13:08):

Oh wow! I didn't realize you had to switch it, thank you for doing that :)

view this post on Zulip GuillaumeGomez (Dec 12 2020 at 13:26):

Well, I wanted to add lints. Before that it was a bit weird. It remained the same for years until some day I realized that rustdoc had no lints nor "compilation errors"

view this post on Zulip GuillaumeGomez (Dec 12 2020 at 13:26):

just some errors and exits


Last updated: Oct 21 2021 at 21:32 UTC