Improve method suggestion for methods with custom receiver type #138887
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
playground
Current output
Desired output
Rationale and extra context
This issue becomes particularly important during refactoring scenarios. Consider this common situation:
&self
&Arc<Self>
&Foo
breaks, and the compiler suggests unrelated similarly named methodsThe current error message can mislead developers into thinking the method was renamed (especially when it suggests alternative methods like
no_frob
), when in reality the method still exists but requires a different receiver type. This can lead to:Arc
)Other cases
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: