-
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
Made Self
a keyword.
#22158
Made Self
a keyword.
#22158
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
Could you tag this as a |
@@ -1797,7 +1797,11 @@ impl<'a> Parser<'a> { | |||
let mut segments = Vec::new(); | |||
loop { | |||
// First, parse an identifier. | |||
let identifier = self.parse_ident(); | |||
let identifier = if self.is_self_type_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.
Maybe this could be factored out into self.parse_ident_or_self_type()
?
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.
I guess that would make it somewhat more clear, yeah.
5409574
to
0d7ec46
Compare
}, | ||
_ => { | ||
let token_str = self.this_token_to_string(); | ||
self.fatal(&format!("expected `Self`, found `{}`", |
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.
there's no test for this error message
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.
Right, this error message can not actually trigger right now, its just there because I copied the two parser functions for the self
keyword.
@bors r+ 0d7ec46 |
(sorry, hit wrong button by accident) |
@bors r+ 0d7ec46 |
⌛ Testing commit 0d7ec46 with merge 0c409ae... |
💔 Test failed - auto-mac-32-opt |
Whoops, forgot to actually test a full bootstrap, and it seems like pattern bindings with the identifier |
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes rust-lang#22137
0d7ec46
to
07d00de
Compare
Should pass |
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
💔 Test failed - auto-linux-32-opt |
Hm, the failure doesn't seem to be related to the PR, and does not reproduce locally. |
@bors: retry |
⌛ Testing commit 07d00de with merge b63cee4... |
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
It is only allowed in paths now, where it will either work inside a
trait
or
impl
item, or not resolve outside of it.[breaking-change]
Closes #22137