-
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
librustc: Forbid ..
in range patterns.
#17584
Conversation
7a908d5
to
4bbb7a9
Compare
* Use ... instead of .. when matching a range, in preparation for rust-lang/rust#17584 (may not be complete). * Use the new slicing syntax (a[], a[x..y]) if possible. (Currently String::as_slice() is blocked by rust-lang/rust#17502.) * Change deprecated String::push_char() to String::push().
self.look_ahead(2, |t| { | ||
*t != token::COMMA && *t != token::RBRACKET | ||
}) { | ||
let start = self.parse_expr_res(RestrictionNoBarOp); | ||
// FIXME(#17295) remove the DOTDOT option (self.eat(&token::DOTDOTDOT)). | ||
if self.token == token::DOTDOTDOT || self.token == token::DOTDOT { | ||
if self.token == token::DOTDOTDOT { |
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.
Should be self.eat(&token::DOTDOTDOT)
I also have a patch for this, so this is a lot of wasted effort. I filed the bug and it was a follow-up to code I had written, so it would have been good to check I didn't have a patch in the works. I am working on the other follow ups btw. r=me with the one comment fixed. |
4bbb7a9
to
11271a0
Compare
This breaks code that looks like: match foo { 1..3 => { ... } } Instead, write: match foo { 1...3 => { ... } } Closes rust-lang#17295. [breaking-change]
11271a0
to
416144b
Compare
…29581 This breaks code that looks like: match foo { 1..3 => { ... } } Instead, write: match foo { 1...3 => { ... } } Closes #17295. r? @nick29581
Ranges must use the `...` syntax as of [rust PR #17584](rust-lang/rust#17584)
@pcwalton I found a remaining two-dots range pattern in
I think we can also supply a clarifying phrase "(three dots)" there. |
Implement symbol interning infra Will fix rust-lang/rust-analyzer#15590 My unsafe-fu is not the best but it does satisfy miri. There is still some follow up work to do, notably a lot of places using strings instead of symbols/names, most notably the token tree.
This breaks code that looks like:
Instead, write:
Closes #17295.
r? @nick29581