Compiler Missing Hint Of Misusing Methods As Functions

I recently found that the compiler is missing a good hint of misusing methods as functions. For example, if there is fn foo(&self);, and I called bar::foo() instead of (the correct one), the compiler wil emit error[E0433]: failed to resolve: use of undeclared type or module 'val'. For your convenience, here goes a playground link:

I think this should be improved, but I wonder whether this requires a RFC, and, if yes, does there exist any RFCs I can use as a guidance of writing the RFC. If not, then how would I contribute to Rust?

Besides, would anyone come up with a better idea of how this should be handled? As far as I see, a note would be attached if such mistake detected.

Sorry for any possible disturbance, but I am quite a newbie to Rust compiler, and I really need some guidance.

1 Like

Simply improving the error message doesn't require an RFC.


Please post an issue on the rust-lang/rust repository, providing a reasonably minimal example, the output, and suggestions for what you'd like to see. This seems entirely reasonable.