-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Remove ExplicitSelf from AST #33644
Remove ExplicitSelf from AST #33644
Conversation
The logic is the same as in #33505: self argument is kept in the argument list as a usual Regarding PS: |
I'd like to explore the design space a bit here. My motivation is that the AST should be as close as possible to the source text. It is meant to be useful as a representation of the source, rather than a more abstract representation of the program (which is the job of the HIR). As such, I think it is less important to make the AST as small as possible at the expense of losing information about the original program. The fact that we need the bool hack in What is the motivation for this? AIUI the major problem is that explicit self is represented both by an argument and by an The obvious fix seems to be remove it from the argument list (clearly it ought to be in the argument list in the HIR, but I don't see a need in the AST). Alternatively, we could make an |
e6a6482
to
a8025bf
Compare
To remove as much code as possible :)
Indeed! However, as long as one of the two representations (separate self, which may be intuitively close to the source, vs uniform self) can be easily and losslessly converted to another, it's largely a question of defaults. And I argue, that the uniform default is more convenient. (The current duplication is the worst from both worlds, for example, name resolution for identifiers is done on the self from argument list, and name resolution for lifetimes is done on self from I've pushed one more commit, adding a new AST-only type variant |
Thanks for the update, I like the idea of using |
👍 on |
ping @Manishearth, this is supposed to be a part of the breaking batch too |
Is this reviewed? if not, could someone review it? |
@Manishearth: r+ |
The AST part of rust-lang#33505. rust-lang#33505 isn't landed yet, so this PR is based on top of it. r? @nrc plugin-[breaking-change] cc rust-lang#31645 @Manishearth
The AST part of rust-lang#33505. rust-lang#33505 isn't landed yet, so this PR is based on top of it. r? @nrc plugin-[breaking-change] cc rust-lang#31645 @Manishearth
The AST part of #33505.
#33505 isn't landed yet, so this PR is based on top of it.
r? @nrc
plugin-[breaking-change] cc #31645 @Manishearth