Skip to content

Check redundant_explicit_links against generated URLs#156009

Draft
qaijuang wants to merge 1 commit intorust-lang:mainfrom
qaijuang:rustdoc-redundant-explicit-links-url
Draft

Check redundant_explicit_links against generated URLs#156009
qaijuang wants to merge 1 commit intorust-lang:mainfrom
qaijuang:rustdoc-redundant-explicit-links-url

Conversation

@qaijuang
Copy link
Copy Markdown
Contributor

@qaijuang qaijuang commented Apr 30, 2026

Fixes #155458.

rustdoc::redundant_explicit_links checked explicit link destinations by resolving both the label and the destination as intra-doc paths. That misses links written as local rustdoc page URLs, such as struct.B.html, because those URLs do not appear in doc_link_resolutions.

This PR keeps the existing path-resolution check and falls back to comparing the explicit destination with the local href rustdoc would generate for the resolved label. Fragmented URLs remain non-redundant, since removing the explicit target would change the destination.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 30, 2026
@qaijuang qaijuang changed the title rustdoc: Check redundant_explicit_links against generated URLs Check redundant_explicit_links against generated URLs Apr 30, 2026
@qaijuang
Copy link
Copy Markdown
Contributor Author

cc @lolbinarycat

@rust-log-analyzer

This comment has been minimized.

@qaijuang qaijuang force-pushed the rustdoc-redundant-explicit-links-url branch from 78cc7d7 to 52290d1 Compare April 30, 2026 16:46
@rust-log-analyzer

This comment has been minimized.

@qaijuang qaijuang force-pushed the rustdoc-redundant-explicit-links-url branch from 52290d1 to 4c47005 Compare April 30, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc: redundant_explicit_links does not fire when link target is url segment.

3 participants