-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bad suggestions when initializing enum as struct #99357
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.