unhelpful diagnostic: trying to compare f64 and &f64 for equality gives E0277 but E0308 would be better #45109
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
If I try to compare an f64 with an &f64:
(where user.countmap is a HashMap<String, f64>) then rust tells me
helpfully pointing me to the fact I need to add an & to the constant.
However if I do the same thing for equality comparison:
the error is much more obscure:
It would be helpful if rust could produce E0308 for this mistake in all kinds of comparison.
I'm using this version of rust:
The text was updated successfully, but these errors were encountered: