ICE when calling mutation method on map value indexed with mutable reference #44405
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When calling a mutation method on an value obtained from a HashMap with a mutable reference index, an ICE occurs.
Code:
Compiler output:
Backtrace:
I believe that the correct behavior here would be for the compiler to report an error to the user on the indicated line due to IndexMut not being implemented for HashMap, which is what occurs when replacing
&mut i
with just&i
.rustc version:
The text was updated successfully, but these errors were encountered: