Suggest .as_ref()
on E0382 when possible
#84165
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: lifetime related
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
The current output is:
We should suggest calling
.as_ref()
before the.map(...)
, as we do in some type errors.This has been seen to cause trouble in the wild https://news.ycombinator.com/item?id=26794551
The text was updated successfully, but these errors were encountered: