Conversation
cf5dc8c to
2cd24ce
Compare
| [unresolved]: #unresolved-questions | ||
|
|
||
| Sublist binding syntax conflicts with possible exclusive range patterns | ||
| `begin .. end`/`begin..`/`..end`. This problem already exists for slice patterns and has to be |
There was a problem hiding this comment.
Slice patterns are unstable (and buggy), and thus can easily be changed.
There was a problem hiding this comment.
Extensions proposed in this RFC are going to be unstable too and are supposed to be changed together with slice patterns if changed at all.
|
Should |
Yes, |
|
This was pretty Always The Plan -- but we never did it because it involved work. I'm basically 👍 though I've not read the details of the RFC. |
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`. This is the HIR part of #31581. This is also kind of a preparation for rust-lang/rfcs#1492. r? @eddyb
|
Implementation (without sub-list bindings): rust-lang/rust#32079 |
|
Nominating for FCP. |
|
Hear ye, hear ye! This RFC is now entering final comment period. |
|
@petrochenkov very well... to be honest I've not read this closely, though I'm in favor of the spirit. We had decided to put this into FCP, but would you rather we wait? (We can keep your proposed edit in mind, I imagine.) |
| [subpat1, .., subpatN] | ||
| // Slice patterns, any of the above with a subslice binding. | ||
| // By ref bindings are allowed, slices and subslices always have compatible layouts. | ||
| [subpat1, binding.., subpatN] |
There was a problem hiding this comment.
What does this binding mean? This feels like it overlaps with slice patterns, which (I think) still require some further RFC to "complete"? I can't remember if we postponed that work or not. :)
There was a problem hiding this comment.
What does this binding mean?
A subslice pattern, see above - "The binding is not actually a binding, but one more pattern ..."
|
I'd be (more) in favor of a variant of this that excludes all "bindings". In other words, allowing: and I'd probably prefer to exclude The binding forms introduce complicated semantics. |
This RFC doesn't propose any changes to slice patterns, it only uses them for analogy.
With this I agree. |
Huh. OK, I must have misread it. So much the better. |
|
I missed that subtlety too - maybe removing the slice examples might make it clearer? |
|
Huzzah! The @rust-lang/lang team has decided to accept this RFC. Specifically:
|
|
Tracking issue: rust-lang/rust#33627 If you'd like to keep following the development of this feature, please subscribe to that issue, thanks! :) |
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`. This is the HIR part of rust-lang/rust#31581. This is also kind of a preparation for rust-lang/rfcs#1492. r? @eddyb
Permit the
..pattern fragment in more contexts.Rendered