Confusing error suggests giving a type to an unrelated variable #77982
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
(playground)
I expected to see this happen: error pointing to
opt.as_ref()
Instead, this happened: error points to
descr
which is unrelated to the errorMeta
Tested with
rustc 1.47.0 (18bf6b4f0 2020-10-07)
andrustc 1.49.0-nightly (2020-10-14 e160e5cb80652bc2afe7)
The text was updated successfully, but these errors were encountered: