Skip to content

fix: Remove confusing self-links from Diag docs - #165564

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
SamB:dizzying-diag-doc-links
Nov 7, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
SamB:dizzying-diag-doc-links

Conversation

@SamB

@SamB SamB commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

I became a bit lost when I encountered these links, for example at: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/diagnostic/struct.Diag.html#method.span_label

It appears that these were caused by commit
f6f8779 ("Reduce capabilities of Diagnostic.").

Formerly, the docs for with_foo and foo would both link to the docs for foo on an "impl" struct, but that commit moved those methods over to the outer struct and changed the links to point to the original method there, for both the original and with_ variants.

This is the appropriate target ... except you don't need to go see it when you're already seeing it.

It's a bit of a big refactoring moving a bunch of code, so it is understandable that such a small detail wasn't really noticed with all of those method bodies flying around.

I became a bit lost when I encountered these links, for example at:
<https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/diagnostic/struct.Diag.html#method.span_label>

It appears that these were caused by commit
f6f8779 ("Reduce capabilities of
`Diagnostic`.").

Formerly, the docs for with_foo and foo would both link to the docs for
foo on an "impl" struct, but that commit moved those methods over to the
outer struct and changed the links to point to the original method
there, for both the original and with_ variants.

This *is* the appropriate target ... except you don't need to go see
it when you're already seeing it.

It's a bit of a big refactoring moving a bunch of code, so it is
understandable that such a small detail wasn't really noticed with all
of those method bodies flying around.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 6, 2026
@rustbot

rustbot commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @JohnTitor (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 79 candidates
  • Random selection from 22 candidates

@JohnTitor JohnTitor left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, @bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1b7f580 has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 7, 2026
Rollup of 13 pull requests

Successful merges:

 - #164914 (Specialize more builtin types for `<[MaybeUninit<_>]>::write_default()`)
 - #165078 (Use the `2.38` binutils version in CI)
 - #165427 (rustdoc: Make implementors collapseable if there is more than one line of docs)
 - #165444 (Suggest using `ExitCode` instead of calling `exit`)
 - #165571 (Support mutable captures in move expressions)
 - #165379 (Autolabel `std::sys` modules)
 - #165503 (update Enzyme submodule)
 - #165519 (Update books)
 - #165534 (rename MIR_borrow_checking timing scope to less confusing name)
 - #165546 (Expose `str::split_at_[mut_]unchecked` and `OsStr::split_at_unchecked`)
 - #165561 (Assorted opt-dist fixes and improvements)
 - #165564 (fix: Remove confusing self-links from Diag docs)
 - #165570 (fix `-Zvirtual-function-elimination` error message)
@rust-bors
rust-bors Bot merged commit 4fb0a48 into rust-lang:main Nov 7, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 7, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 7, 2026
Rollup merge of #165564 - SamB:dizzying-diag-doc-links, r=JohnTitor

fix: Remove confusing self-links from Diag docs

I became a bit lost when I encountered these links, for example at: <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/diagnostic/struct.Diag.html#method.span_label>

It appears that these were caused by commit
f6f8779 ("Reduce capabilities of `Diagnostic`.").

Formerly, the docs for with_foo and foo would both link to the docs for foo on an "impl" struct, but that commit moved those methods over to the outer struct and changed the links to point to the original method there, for both the original and with_ variants.

This *is* the appropriate target ... except you don't need to go see it when you're already seeing it.

It's a bit of a big refactoring moving a bunch of code, so it is understandable that such a small detail wasn't really noticed with all of those method bodies flying around.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants