Compiler does not suggest to dereference a reference to reference #93983
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.
If I miss a
*
when assigning to a variable, rustc suggests dereferencing it:Playground.
But not the referent is a reference:
Playground.
This is because in compiler/rustc_typeck/src/check/demand.rs, we first check whether both the LHS and RHS are references and try to suggest adding/removing
b"..."
. But even if we did not succeed in that check, we don't continue to the next check where we check whether the LHS is a reference and should be dereferenced:rust/compiler/rustc_typeck/src/check/demand.rs
Lines 593 to 627 in b117335
The text was updated successfully, but these errors were encountered: