Repository navigation
fix: Remove confusing self-links from Diag docs - #165564
Merged
Merged
Conversation
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.
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:
|
JohnTitor
approved these changes
Nov 7, 2026
Contributor
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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.