We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
fn f(_: bool) {} struct Foo { cx: bool, } impl Foo { fn bar() { f(cx); } } fn main() {}
<anon>:9:11: 9:13 error: unresolved name `cx`. Did you mean `self.cx`? [E0425] <anon>:9 f(cx); ^~
The text was updated successfully, but these errors were encountered:
Working on it.
Sorry, something went wrong.
I think if the error is just "unknown variable cx", then it will confuse beginners. It's not obvious for beginners that this is static method.
It's possible to add a note saying "you're in a static method so you don't have access to this type's fields".
That would be perfect.
Auto merge of #33615 - GuillaumeGomez:field_static_method, r=pnkfelix
487de42
Don't suggest using fields in a static method Fixes #33613. cc @LeoTestard
No branches or pull requests
The text was updated successfully, but these errors were encountered: