Improve error message E0608 when the type supports Index but Idx is missing trait bounds #110373
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-trait-system
Area: Trait system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code (playground):
I expected to see this happen: rustc outputs an error saying that I need to add the
Eq
andstd::hash::Hash
traits onV
.Instead, this happened:
which is jarring to see, and unhelpful, because HashMap does support Index, but only with particular trait bounds on
V
.The text was updated successfully, but these errors were encountered: