-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 HIR #33505
Remove ExplicitSelf from HIR #33505
Conversation
LGTM, cc @nrc, @Manishearth, @jseyfried |
impl Arg { | ||
#[unstable(feature = "rustc_private", issue = "27812")] | ||
#[rustc_deprecated(since = "1.10.0", reason = "use `from_self` instead")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually sort of cool 👍.
I think this is good. Question (more important for an AST change than the HIR): can we tell the difference between |
Yes, |
@petrochenkov hmm, that seems fine for the HIR, but not ideal for the AST. We should maybe try something else there. |
Hm, with this PR |
This feels like something which should be caught and reported during lowering, rather than being stored in the HIR (to clarify, I think we should catch this before landing this PR). |
☔ The latest upstream changes (presumably #33443) made this pull request unmergeable. Please resolve the merge conflicts. |
I've added a special check for |
☔ The latest upstream changes (presumably #33425) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased. |
r? nrc |
☔ The latest upstream changes (presumably #33532) made this pull request unmergeable. Please resolve the merge conflicts. |
Fix spans and expected token lists, fix rust-lang#33413 + other cosmetic improvements Add test for rust-lang#33413 Convert between `Arg` and `ExplicitSelf` precisely Simplify pretty-printing for methods
Rebased. |
@bors: r+ |
📌 Commit a62a690 has been approved by |
@bors: r- (Whoops, wrong PR) |
/// `self`, `mut self` | ||
Value(Ident), | ||
/// `&'lt self`, `&'lt mut self` | ||
Region(Option<Lifetime>, Mutability, Ident), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Borrowed
is better than Region
, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nm, this is just moved code
@bors: r+ |
📌 Commit a62a690 has been approved by |
Remove ExplicitSelf from HIR `self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication. The same changes can be applied to AST, I'll make them in the next breaking batch. The first commit also improves parsing of method declarations and fixes #33413. r? @eddyb
Seems like this PR broke my compiler plugin. Can't you please help to fix it? UPD: problem solved (see topic) |
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
self
argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication.The same changes can be applied to AST, I'll make them in the next breaking batch.
The first commit also improves parsing of method declarations and fixes #33413.
r? @eddyb