diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-10-30 11:50:26 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-30 11:50:26 +0530 |
| commit | 3143472863c473d246ffb741c1bc46f2697706ec (patch) | |
| tree | 72747385204335066221e6b42b394dbe368be6ad /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | b4cf523cb5aee9f65bbc53bb19931e9a64838982 (diff) | |
| parent | 0eaf6d518026ccc4bd97444cd6a485accdc79878 (diff) | |
| download | rust-3143472863c473d246ffb741c1bc46f2697706ec.tar.gz rust-3143472863c473d246ffb741c1bc46f2697706ec.zip | |
Rollup merge of #103560 - zbyrn:issue-103358-fix, r=cjgillot
Point only to the identifiers in the typo suggestions of shadowed names instead of the entire struct Fixes #103358. As discussed in the issue, the `Span` of the candidate `Ident` for a typo replacement is stored alongside its `Symbol` in `TypoSuggestion`. Then, the span of the identifier is what the "you might have meant to refer to" note is pointed at, rather than the entire struct definition. Comments in #103111 and the issue both suggest that it is desirable to: 1. include names defined in the same crate as the typo, 2. ignore names defined elsewhere such as in `std`, _and_ 3. include names introduced indirectly via `use`. Since a name from another crate but introduced via `use` has non-local `def_id`, to achieve this, a suggestion is displayed if either the `def_id` of the suggested name is local, or the `span` of the suggested name is in the same file as the typo itself. Some UI tests have also been modified to reflect this change. r? `@cjgillot`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
