-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Currently, we suggest typo fixes in case of function calls, locals, and field accesses. So, both the marked lines below will suggest the correct fix:
struct A {foo: u8}
fn main() {
let x = A {foo: 1};
x.fob; // here
let aaaaaaa=1;
let z = aaaaaab; // here
}
However, this is not the case for imports, crates, and inline paths. We should fix this.
This is probably not an easy bug, but should be fun. Basically you need to look for the source of the "could not find X" error, and do something similar to
rust/src/librustc_resolve/lib.rs
Line 3625 in 99925fb
fn find_best_match_for_name(&mut self, name: &str) -> SuggestionType { |
@apasel422 @wafflespeanut want to work on this?
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.