Improvements to range match patterns#880
Improvements to range match patterns#880quantheory wants to merge 5 commits intorust-lang:masterfrom
Conversation
text/0000-one-sided-match-ranges.md
Outdated
There was a problem hiding this comment.
Shouldn't it be:
...j will match all numbers less than j?
|
Thanks @mdinger, fixed. |
|
Since |
|
@oli-obk To be honest, I found it a bit difficult to figure out the front-runner in that thread, since there are a lot of different suggestions there, and so I basically decided to ignore it until there's some specific proposal that comes out of that discussion. If exclusive ranges were allowed in patterns, I would say that |
|
Hmm. This seems like a nice thing to have, but I think it's probably going to have to come after 1.0, which implies that the exhaustiveness checking will have to be weaker, which is probably ok. |
|
We discussed this at the triage meeting today. We all thought it was probably a nice addition to the language, however, it is too low priority to consider before 1.0. Therefore I will close this as postponed. Tracking issue is #947. |
|
Bump. I except this and semiopen (It's not a priority although). |
|
Is there any possibility of this getting split into two RFCs? I'm specifically interested in the exhaustive pattern matching. |
We can currently use patterns of the form
2...5in matches, but not2...or...5(which one would expect by analogy withRangeTo/RangeFrom). This RFC adds those new forms; I will update it if the existing pattern range syntax is going to change.Additionally, this RFC proposes performing exhaustiveness checks on patterns for integer types and
char.Note: Since there are a lot of RFC PRs recently, including several that I've proposed, I want to note that this one in particular poses a (rather minor) backwards compatibility issue. Some rare match patterns that compile now would be rejected.
Rendered.