Enhance suggestions for unresolved links with typos path - #159502
Merged
rust-bors[bot] merged 1 commit intoAug 27, 2026
Merged
Conversation
mejrs
requested changes
Aug 18, 2026
| let span = span | ||
| .with_lo(span.lo() + BytePos(start as u32)) | ||
| .with_hi(span.lo() + BytePos((start + unresolved.len()) as u32)); | ||
| diag.span_suggestion_verbose(span, msg, candidate, Applicability::MaybeIncorrect); |
Member
There was a problem hiding this comment.
Is this bytepos arithmetic really necessary? Perhaps consider just suggesting the proper path for the entire span.
| let children = module.as_local().map_or_else( | ||
| || tcx.module_children(module.to_def_id()), | ||
| |local_module| tcx.module_children_local(local_module.to_local_def_id()), | ||
| ); |
Member
There was a problem hiding this comment.
I don't really like map_or_else, i would write it like this, but up to you
let children = if let Some(local_id) = module {
...
} else {
...
}
chenyukang
force-pushed
the
yukang-fix-159496-rustdoc-link-typo
branch
from
August 25, 2026 13:42
1e67410 to
fa36454
Compare
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. |
Member
Author
|
@rustbot ready |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 26, 2026
Rollup of 5 pull requests Successful merges: - #159502 (Enhance suggestions for unresolved links with typos path) - #161052 (Add regression test for generic inference) - #161210 (Improve missing extern crate diagnostics in Rust 2015) - #161818 (Fix long type on diagnostics for conditionally implemented traits) - #161839 (Fix doc link to pointer::addr)
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.
Fixes #159496
r? @estebank