When a function name within a method is not found, suggest calling the method of the same name #103474
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.
Given the following code (playground):
The current output is:
Ideally the output should mention the fact that a method with this name was found on the same struct. And perhaps suggest calling the method on
self
, especially if the self-param types are compatible (e.g. both take an immutable&self
reference).Motivation
This may be a common error for programmers coming from C++, because C++ does not require specifying the instance for method-to-method calls.
C++ example
The text was updated successfully, but these errors were encountered: