Poor error message when the LHS of an assignment must be dereferenced #46276
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
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.
WG-diagnostics
Working group: Diagnostics
Code (also available on playground):
Error:
Okay, but why cannot
+=
be applied toMutexuard<'_, {integer}>
? And what can we do about it? :)I'd prefer if the error message included something like:
Such a help message could be printed whenever the LHS of an assignment must be dereferenced. The same applies to situations in which we must dereference more than once, e.g
**a
.The text was updated successfully, but these errors were encountered: