Invalid Left-hand Assignment Provides Incorrect Syntax as Solution #93486
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I was attempting to assign directly to the result of a vector's
last_mut()
, which caused this error to fire. That is when I discovered that the help section was telling me to do add an extra let to my while statement, which is not syntactically correct.I tried this code:
I expected to see this happen:
The code would fail to compile and the help message would tell me to dereference the left side, or at the least give me code that was syntactically correct.
Instead, this happened:
The could failed to compile, and the help message gave syntactically incorrect code as seen in the backtrace section.
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: