rustdoc: do not include extra stuff in span#157561
Conversation
|
rustbot has assigned @lolbinarycat. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
p.s. this change is a lot easier to understand if you use the hide whitespace setting on the diff. |
This comment has been minimized.
This comment has been minimized.
d2784cd to
9af61c5
Compare
This comment has been minimized.
This comment has been minimized.
9af61c5 to
7db2845
Compare
This comment has been minimized.
This comment has been minimized.
7db2845 to
9d216d1
Compare
This comment has been minimized.
This comment has been minimized.
|
The Clippy subtree was changed cc @rust-lang/clippy |
31c9e0e to
d13270c
Compare
This comment has been minimized.
This comment has been minimized.
This change prevents our lints from returning a span with stuff in it that isn't actually part of the doc comment. When that happens, it returns `None` instead.
d13270c to
33fb30e
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Do we need to be optimizing our diagnostic code (cold path) to the extent of using binary search to find an item in a usually small list? this only speeds up doc generation if a crate has a ton of warnings. I guess I'll see if it shows up at all in a perf run. @bors try @rust-timer queue profiles=doc |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rustdoc: do not include extra stuff in span
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (a64b630): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 518.069s -> 524.961s (1.33%) |
I knew it would be O(n2) if just did a linear scan. Even in the cold path, I'd prefer to avoid that. |
This comment has been minimized.
This comment has been minimized.
It requires an allocation, and doesn't seem to help in practice. Fixes a nit found during review.
93b65a3 to
ae2edb4
Compare
|
@bors try @rust-timer queue profiles=doc |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rustdoc: do not include extra stuff in span
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (1a5fffe): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 521.088s -> 525.76s (0.90%) |


View all comments
This change prevents our lints from returning a span with stuff in it that isn't actually part of the doc comment. When that happens, it returns
Noneinstead.Fixes rust-lang/rust-clippy#16169, since the bug was reported against the
clippy::doc_paragraphs_missing_punctuationlint but is actually a bug insource_span_for_markdown_range_inner.