hint to consider dereferencing instead of mutably borrowing an immutable variable #112958
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
rustc should not hint to mutably borrow an immutable variable
b
(or also tell to make it mutable, but this does not work ifb
is borrowed), it should hint to dereferencea
(*a < b
) or converta
to an immutable reference and referenceb
(&*a < &b
)Other cases
No response
Anything else?
the same message with stable, beta and nightly, only stable doesnt show where to insert
&mut
The text was updated successfully, but these errors were encountered: