Include explicit (de)referencing in E0283 #84156
Labels
A-coercions
Area: implicit and explicit `expr as Type` coercions
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (playground):
The current output is:
Ideally the output should look like:
The compiler already determined that the
v
needed to be deref coerced to&Borrowed
but then suggested invoking::borrow(v)
which obviously won't type check; it should suggest invoking::borrow(&v)
instead (and likewise for the mutable case). If dereferencing was required in the method resolution, then that should also be included in the suggestion:::borrow(&**v)
etc.@rustbot label: A-coercions A-diagnostics A-inference -C-enhancement C-bug D-invalid-suggestion
The text was updated successfully, but these errors were encountered: