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.
d13270c to
33fb30e
Compare
This comment has been minimized.
This comment has been minimized.
|
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 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. |
Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com>
Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com>
Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com>
|
@bors r=lolbinarycat |
…name, r=lolbinarycat rustdoc: do not include extra stuff in span 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. Fixes rust-lang/rust-clippy#16169, since the bug was reported against the `clippy::doc_paragraphs_missing_punctuation` lint but is actually a bug in `source_span_for_markdown_range_inner`.
…name, r=lolbinarycat rustdoc: do not include extra stuff in span 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. Fixes rust-lang/rust-clippy#16169, since the bug was reported against the `clippy::doc_paragraphs_missing_punctuation` lint but is actually a bug in `source_span_for_markdown_range_inner`.
…uwer Rollup of 18 pull requests Successful merges: - #157385 (Enable Enzyme on x86_64-apple) - #157561 (rustdoc: do not include extra stuff in span) - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158697 (Fixes for QNX SDP 8) - #158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - #157801 (Rewrite safety requirements for `Allocator` impls) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158841 (Avoid final override ICE for RPITIT associated types) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args)
|
Probably this PR? |
|
This pull request was unapproved. This PR was contained in a rollup (#158923), which was unapproved. |
This comment has been minimized.
This comment has been minimized.
rustdoc: do not include extra stuff in span try-job: dist-x86_64-linux-alt
|
💔 Test for 06b5f85 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
This is a weird, but unrelated, problem with doc comments and attribute
macros. If I remove the `#[instrument]` attribute, the lint behaves the
way it's supposed to, and points directly at the link instead of
pointing at the whole line.
warning: redundant explicit link target
--> compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:2373:5
|
2373 | /// Lower a [`hir::ConstArg`] to a (type-level) [`ty::Const`](Const).
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ explicit target `Const` is redundant because label `ty::Const` resolves to same destination
|
= note: when a link's destination is not specified,
the label is used to resolve intra-doc links
= note: `#[warn(rustdoc::redundant_explicit_links)]` on by default
|
HIR ty lowering was modified cc @fmease |
|
@bors r=lolbinarycat |
…name, r=lolbinarycat rustdoc: do not include extra stuff in span 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. Fixes rust-lang/rust-clippy#16169, since the bug was reported against the `clippy::doc_paragraphs_missing_punctuation` lint but is actually a bug in `source_span_for_markdown_range_inner`.
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.