-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Don't bail out on non-calls in resolver diagnostics #109250
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
rust/compiler/rustc_resolve/src/late.rs
Lines 3480 to 3488 in 511364e
When a path is failed to be resolved, rustc will enrich the error with many suggestions like adding missing imports.
For example
suggests adding the missing import.
But as seen in the code above, it just bails out on paths where there is no call, like
This is probably a weird hack around some oddity in the suggestion code (maybe the extremely hacky diagnostics merging that happens in there).
Remove the early return above and figure out what happens. If nothing bad happens, great. If something bad happens, figure out why and fix it properly.