Skip to content

Check redundant_explicit_links against generated URLs#156009

Open
qaijuang wants to merge 1 commit into
rust-lang:mainfrom
qaijuang:rustdoc-redundant-explicit-links-url
Open

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

Conversation

@qaijuang

@qaijuang qaijuang commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

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 that rustdoc would generate for the resolved label.

@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
@qaijuang qaijuang marked this pull request as ready for review April 30, 2026 19:36
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 30, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 30, 2026
@rustbot

rustbot commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: rustdoc
  • rustdoc expanded to 9 candidates
  • Random selection from GuillaumeGomez, fmease, lolbinarycat, notriddle

@qaijuang qaijuang force-pushed the rustdoc-redundant-explicit-links-url branch from 4c47005 to 8a48cea Compare April 30, 2026 19:49
@qaijuang

Copy link
Copy Markdown
Contributor Author

I just noticed #156711, which seems related to broader rustdoc/compiler path-resolution work.

Does that tracking issue change the desired direction for this PR? If the preferred approach is to wait for the broader item-signature resolution mechanism, I’m happy to adjust/park this, but I’d appreciate guidance so I know whether this PR is still worth pursuing.

@fmease

fmease commented May 18, 2026

Copy link
Copy Markdown
Member

I've yet to review your PR (sorry about that), so I can't tell for certain. However, I'm inclined to believe that the feature described in that tracking issue is not relevant. Double-checking that later.

@rust-bors

This comment has been minimized.

@qaijuang

Copy link
Copy Markdown
Contributor Author

☔ The latest upstream changes (presumably #159046) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

will rebase rq

@qaijuang qaijuang force-pushed the rustdoc-redundant-explicit-links-url branch from 8a48cea to da95d5c Compare July 10, 2026 08:42
@rustbot

rustbot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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.

@qaijuang

Copy link
Copy Markdown
Contributor Author

Seems @fmease is tight on schedule, safe to @rustbot reroll

@rustbot rustbot assigned GuillaumeGomez and unassigned fmease Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

5 participants