Don't bail out on non-calls in resolver diagnostics #109250
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
The text was updated successfully, but these errors were encountered: