-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unclear error message recommending the same wrong code #34352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There's a suggestion that is supposed to tell you that you can call the function as
So this bug is apparently fixed already. (I recall seeing a PR that improved this diagnostic but I can't find it know.) Thanks for reporting though! |
I think I found the PR: #32712 |
Great! If this is fixed in nightly, should this issue be closed or remain open until that is stable? |
The usual policy is to close when it's fixed on nightly. |
Makes sense. Thanks for looking into this! |
Rust Playground Link: https://is.gd/1A99qU
I was in the middle of coming up with a toy example so I could ask someone how I can call a function stored in
Rc
when I noticed this:On the third line of the error message, it says "did you mean to write
foo.f
?" Then on the next line, it shows that I did in fact writefoo.f(...)
. This is clearly incorrect as it would result in the same code.Here's the code that is causing the problem:
Now that I am writing all of this out, I think the error message is suggesting that I write only
foo.f
and get the property instead of calling it as a function. If that's the case, then the error message should probably be clarified because that is not clear from the current message in this case.Since I wrote this on the Rust Playground using the stable version of Rust, I assume that the version info is around the same as my local version which is also running the latest Rust:
The text was updated successfully, but these errors were encountered: