librustc: Forbid .. in range patterns.#17584
Merged
bors merged 1 commit intorust-lang:masterfrom Oct 1, 2014
Merged
Conversation
7a908d5 to
4bbb7a9
Compare
kennytm
added a commit
to kennytm/qrcode-rust
that referenced
this pull request
Sep 27, 2014
* 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().
src/libsyntax/parse/parser.rs
Outdated
Member
There was a problem hiding this comment.
Should be self.eat(&token::DOTDOTDOT)
Member
|
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
bors
added a commit
that referenced
this pull request
Oct 1, 2014
…29581
This breaks code that looks like:
match foo {
1..3 => { ... }
}
Instead, write:
match foo {
1...3 => { ... }
}
Closes #17295.
r? @nick29581
drbawb
added a commit
to drbawb/uuid
that referenced
this pull request
Oct 1, 2014
Ranges must use the `...` syntax as of [rust PR #17584](rust-lang/rust#17584)
This was referenced Oct 1, 2014
Contributor
|
@pcwalton I found a remaining two-dots range pattern in
I think we can also supply a clarifying phrase "(three dots)" there. |
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Jul 28, 2024
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This breaks code that looks like:
Instead, write:
Closes #17295.
r? @nick29581