Uh oh!
There was an error while loading. Please reload this page.
Improve how rustdoc warnings are displayed - #44350
Conversation
QuietMisdreavus
commented
Sep 5, 2017
QuietMisdreavus
commented
Sep 5, 2017
The following version of fncheck_attributes(attrs1:&HashMap<String,String>,attrs2:&HashMap<String,String>) -> bool{/// For strings that match "something-N", returns "something", else returns the whole stringfnextract_attr(value:&str) -> &str{letmut iter = value.rsplitn(2,'-');iflet(Some(n),Some(tag)) = (iter.next(), iter.next()){if n.parse::<usize>().is_ok(){
tag
}else{
value
}}else{
value
}}iflet(Some(id1),Some(id2)) = (attrs1.get("id"), attrs2.get("id")){let tag1 = extract_attr(id1);let tag2 = extract_attr(id2);
tag1 == tag2
}else{
!attrs1.contains_key("id") && !attrs2.contains_key("id")}} |
QuietMisdreavus
commented
Sep 5, 2017
On the other hand, even with that change, it still prints the warning, just now it doesn't print the actual difference. You'll need to float whether to print the warning at all out of |
ollie27
commented
Sep 6, 2017
This isn't a false positive, it's just a bug in rustdoc. The issue is that by rendering the Markdown twice |
GuillaumeGomez
commented
Sep 6, 2017
@ollie27: Yes, that's why we need to catch it (I precised it in the code change I think). |
d423bb2 to
884989aCompareGuillaumeGomez
commented
Sep 6, 2017
Updated. |
QuietMisdreavus
commented
Sep 6, 2017
Fantastic! This cuts down on rendering warnings by an order of magnitude or more when rendering Rocket's dependencies (the first crate i checked). @bors r+ |
bors
commented
Sep 6, 2017
📌 Commit 884989a has been approved by |
ollie27
commented
Sep 6, 2017
I've submitted a PR to actually fix the bug so that none of this is necessary: #44368. |
QuietMisdreavus
commented
Sep 6, 2017
Ooh, nice! @bors r- While i check out this other PR. The "don't print the warning heading" thing is still useful, but the bit about checking the header numbering may be better served with the new PR. |
GuillaumeGomez
commented
Sep 6, 2017
The second commit will still be relevant though. ;) (for other checks) |
QuietMisdreavus
commented
Sep 6, 2017
Since #44368 solves the "headers with diverging IDs" problem in a nicer fashion than the check introduced here, i want to pull that one in. However, like we've both said, this PR does more than that now. If you can yank out that first commit (good thinking, separating them like that 😛) and just keep the second one, we can make this PR focus on that instead. |
bors
commented
Sep 10, 2017
☔ The latest upstream changes (presumably #44474) made this pull request unmergeable. Please resolve the merge conflicts. |
alexcrichton
commented
Sep 14, 2017
@GuillaumeGomez ping to make sure this stays on your radar |
GuillaumeGomez
commented
Sep 15, 2017
@alexcrichton: We now need to confirm that the other PR made this one useless. Waiting for your confirmation @QuietMisdreavus! ;) |
QuietMisdreavus
commented
Sep 15, 2017
Yes, the bit that compared the IDs is superfluous now; #44368 took care of that. However, this PR as a whole isn't "useless", per se:
|
GuillaumeGomez
commented
Sep 15, 2017
@QuietMisdreavus: Doing it! |
5ac512f to
74652b7CompareGuillaumeGomez
commented
Sep 17, 2017
Updated. |
There was a problem hiding this comment.
...i thought we agreed that check_attributes didn't need to be there any more >_>
There was a problem hiding this comment.
Ah my bad, completely misunderstood. ><
74652b7 to
5072972Compare5072972 to
7aa5367CompareQuietMisdreavus
commented
Sep 20, 2017
The PR was patched up to take out the (now-superfluous) @bors r+ |
bors
commented
Sep 20, 2017
📌 Commit 7aa5367 has been approved by |
bors
commented
Sep 20, 2017
…eavus Improve how rustdoc warnings are displayed cc @rust-lang/dev-tools r? @nrc
bors
commented
Sep 20, 2017
☀️ Test successful - status-appveyor, status-travis |

cc @rust-lang/dev-tools
r? @nrc