-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: fix type inference with IndexMut
returning references
#16085
Conversation
&[index_ty.clone().cast(Interner)], | ||
); | ||
|
||
if *is_assignee_expr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does no harm to obligate every indexing for IndexMut
because r-a currently only save obligation that can be solved and it won't need an extra field in HIR, but I believe it's better to be more precise.
9d03293
to
6e3f928
Compare
Thanks! |
☀️ Test successful - checks-actions |
IndexMut
when inferIndexMut
returning references
Closes #15842.
This issue arises because
K
is ambiguous if only inferred fromIndex
trait, but is unique if inferred fromIndexMut
, but r-a doesn't use this info.