Uh oh!
There was an error while loading. Please reload this page.
Error codes checkup and rustdoc test fix - #67850
Conversation
rust-highfive
commented
Jan 4, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Mark-Simulacrum
commented
Jan 4, 2020
I will review once #67837 has been merged and this is rebased atop of it (also, looks like there's a CI failure). |
0dce9d2 to
157a3d1CompareGuillaumeGomez
commented
Jan 4, 2020
Forgot to run rustfmt on the new checker... Let's wait for #67837 now. :) |
157a3d1 to
9d84816CompareGuillaumeGomez
commented
Jan 6, 2020
@Mark-Simulacrum#67837 has been merged. :) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
There is already a step to run rustdoc tests on the error index:
Line 1393 in 1756313
Does it not work properly?
There was a problem hiding this comment.
This is not for the same purpose. ErrorIndex generates it, but it doesn't test that the code examples inside the explanations are compiling (or not) as expected.
There was a problem hiding this comment.
Yes it does. It uses error_index_generator to concatenate all of the error code docs into a single error-index.md file and then runs rustdoc --test on that:
Lines 1411 to 1436 in 1756313
There was a problem hiding this comment.
And I can tell that it doesn't work since a lot of error codes I fixed in this PR weren't detected.
There was a problem hiding this comment.
But why doesn't it work? If we have existing code that overlaps this one, ideally we'd fix the pre-existing code, rather than replace it wholesale (or at least, we should make sure that we're replacing it, rather than just also adding atop it).
There was a problem hiding this comment.
This is a good question. Let me check again.
There was a problem hiding this comment.
Does this really need to be done using a new tool? Rustbuild can already run rustdoc --test on all .md files in a directory using the DocTest step.
Either way this will be slower than the current ErrorIndex step because it will have to call rustdoc --test once for each error code rather than just once for all of them.
There was a problem hiding this comment.
You need to write a tool in any case to import the markdown files. So instead of having everything at once, at least we get a very precise error output. Also, the run is a bit longer, but nothing much bigger.
GuillaumeGomez
commented
Jan 11, 2020
Ping @Mark-Simulacrum |
Mark-Simulacrum
commented
Jan 11, 2020
I think @ollie27's comments around error-index-generator need to get resolved and then I can take another look (or not, if it turns out we're already doing everything necessary here). |
2e8db67 to
5b7d64eCompareGuillaumeGomez
commented
Jan 12, 2020
@ollie27 was absolutely right: adding this new check was useless. I discovered this issue, believing that the change of the error explanations format somehow messed with the run of I think this is ready now. |
Mark-Simulacrum
commented
Jan 12, 2020
Please update the PR description (some of it seems a bit outdated). After that, r=me. |
GuillaumeGomez
commented
Jan 13, 2020
@bors: r=Mark-Simulacrum |
bors
commented
Jan 13, 2020
📌 Commit 5b7d64e has been approved by |
bors
commented
Jan 13, 2020
…acrum Error codes checkup and rustdoc test fix This PR does a few things: * fix how rustdoc checks that an error code has been thrown (it only checked for "E0XXX" so if it appeared in the output because the file has it in its name or wherever, it passed the test, which was incorrect) * fix the failing code examples that weren't throwing the expected error code
bors
commented
Jan 13, 2020
☀️ Test successful - checks-azure |
This PR does a few things: