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: Apply IndexMut obligations for non-assigning mutable index usages #17755

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

ShoyuVanilla
Copy link
Member

Fixes #17738

Currently, we are pushing IndexMut obligations only for assign usages;

if *is_assignee_expr {
if let Some(index_trait) = self.resolve_lang_trait(LangItem::IndexMut) {
let trait_ref = TyBuilder::trait_ref(self.db, index_trait)
.push(self_ty)
.fill(|_| index_ty.clone().cast(Interner))
.build();
self.push_obligation(trait_ref.cast(Interner));
}
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 31, 2024
Copy link
Contributor

@davidbarsky davidbarsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lnicola
Copy link
Member

lnicola commented Jul 31, 2024

@bors r=davidbarsky

@bors
Copy link
Collaborator

bors commented Jul 31, 2024

📌 Commit b5494d7 has been approved by davidbarsky

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 31, 2024

⌛ Testing commit b5494d7 with merge c8e41d9...

@bors
Copy link
Collaborator

bors commented Jul 31, 2024

☀️ Test successful - checks-actions
Approved by: davidbarsky
Pushing c8e41d9 to master...

@bors bors merged commit c8e41d9 into rust-lang:master Jul 31, 2024
11 checks passed
@ShoyuVanilla ShoyuVanilla deleted the issue-17738 branch July 31, 2024 18:24
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.

Type inference missing with defaultmap 0.6.0
5 participants