Skip to content

Suggest self instead of this if it makes sense #54019

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

Closed
mqudsi opened this issue Sep 7, 2018 · 1 comment
Closed

Suggest self instead of this if it makes sense #54019

mqudsi opened this issue Sep 7, 2018 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mqudsi
Copy link
Contributor

mqudsi commented Sep 7, 2018

C++ refugees coming to rust might accidentally use/write this.foo where self.foo was intended. I'm sure a hint to use self instead would be appreciated.

@Centril Centril added A-frontend Area: Compiler frontend (errors, parsing and HIR) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-diagnostics Area: Messages for errors, warnings, and lints C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 7, 2018
@Havvy
Copy link
Contributor

Havvy commented Sep 8, 2018

Likewise from people from JavaScript and also my from Perl, although that one sound a lot more unlikely.

bors added a commit that referenced this issue Oct 2, 2018
Suggest to use self for fake-self from other languages

Closes #54019
r? @estebank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants