Skip to content
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: deduplicate fields and types in completion #15026

Merged
merged 2 commits into from Jun 12, 2023

Conversation

lowr
Copy link
Contributor

@lowr lowr commented Jun 11, 2023

Fixes #15024

  • hir_ty::autoderef() (which is only meant to be used outside hir-ty) now deduplicates types and completely resolves inference variables within.
  • field completion now deduplicates fields of the same name and only picks such field of the first type in the deref chain.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 11, 2023
@Veykril
Copy link
Member

Veykril commented Jun 12, 2023

I never realized that you could have cycles in deref targets 😨
@bors r+

@bors
Copy link
Collaborator

bors commented Jun 12, 2023

📌 Commit 42eab5e has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jun 12, 2023

⌛ Testing commit 42eab5e with merge 6b3659d...

@bors
Copy link
Collaborator

bors commented Jun 12, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 6b3659d to master...

@bors bors merged commit 6b3659d into rust-lang:master Jun 12, 2023
10 checks passed
bors added a commit that referenced this pull request Jun 13, 2023
Deduplicate tuple indices for completion

Follow-up to #15026

A tuple struct may dereference to a primitive tuple (though unusual, which is why I previously overlooked this case). We should not show the same tuple index in completion in such cases.

Deduplication of indices among multiple tuple structs is already handled in the previous PR.
bors added a commit that referenced this pull request Jun 13, 2023
Deduplicate tuple indices for completion

Follow-up to #15026

A tuple struct may dereference to a primitive tuple (though unusual, which is why I previously overlooked this case). We should not show the same tuple index in completion in such cases.

Deduplication of indices among multiple tuple structs is already handled in the previous PR.
bors added a commit that referenced this pull request Jun 13, 2023
Deduplicate tuple indices for completion

Follow-up to #15026

A tuple struct may dereference to a primitive tuple (though unusual, which is why I previously overlooked this case). We should not show the same tuple index in completion in such cases.

Deduplication of indices among multiple tuple structs is already handled in the previous PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When loop Deref Complete duplicate members in the list
5 participants