Fix bad suggestions when initializing enum as struct#99357
Fix bad suggestions when initializing enum as struct#99357danobi wants to merge 1 commit intorust-lang:masterfrom
Conversation
Fix bad suggestions by adding a new heuristic where we assume correct intent when there's an exact match on an in-scope identifier.
|
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
|
I'm not entirely sure this is the right heuristic we should be using here. A better approach would be to check what kind of literal is being tried to be used (struct/tuple/unit?) and see if the field names/count/types match, in order to determine whether we've found an "exact" match. I'm looking at some of the changes and instead of suggesting importing the right |
|
☔ The latest upstream changes (presumably #100708) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@danobi would you have time to try and address the comments? |
|
Hi @estebank , been a bit busy with a move recently. I hope to find some time to revisit this soon. But if anyone wants to take this PR and fix it up, please feel free. |
|
@danobi, no rush. |
|
Ping from triage: |
Fix bad suggestions by adding a new heuristic where we assume correct
intent when there's an exact match on an in-scope identifier.