Incorrect Deref implementation causes incorrect error about importing Clone #131003
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.
Code
Current output
Desired output
Rationale and extra context
The code above contains an incorrect implementation of Deref. The compiler output should contain one error message explaining that the Deref implementation is wrong. Instead, it contains that error message plus another one saying that Clone isn't in scope and needs to be imported before I can use
.clone()
, which is wrong for two reasons: first, it doesn't need to be imported, and second, it already is. If the incorrect Deref implementation is removed, the code compiles without complaining about my use of.clone()
.Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: