1
1
- Feature Name: dotdot_in_patterns
2
2
- Start Date: 2016-02-06
3
- - RFC PR: (leave this empty)
3
+ - RFC PR: https://github.com/rust-lang/rfcs/pull/1492
4
4
- Rust Issue: (leave this empty)
5
5
6
6
# Summary
@@ -69,6 +69,7 @@ S { subpat1, subpat2, .. }
69
69
// anywhere except for one conventionally chosen position (the last one) or in sublist bindings,
70
70
// so we don't propose extensions to struct patterns.
71
71
S { subpat1, .., subpatN }
72
+ // **NOT PROPOSED**: Struct patterns with bindings
72
73
S { subpat1, binding.., subpatN }
73
74
74
75
// Tuple struct patterns, the last and the only position, no extra subpatterns allowed.
@@ -77,22 +78,20 @@ S(..)
77
78
S(subpat1, subpat2, ..)
78
79
S(.., subpatN-1, subpatN)
79
80
S(subpat1, .., subpatN)
80
- // **NEW**: Tuple struct patterns, any position with a sublist binding.
81
- // The binding has a tuple type.
82
- // By ref bindings are not allowed, because layouts of S(A, B, C, D) and (B, C) are not necessarily
83
- // compatible (e.g. field reordering is possible).
81
+ // **NOT PROPOSED**: Struct patterns with bindings
84
82
S(subpat1, binding.., subpatN)
85
83
86
84
// **NEW**: Tuple patterns, any position.
87
85
(subpat1, subpat2, ..)
88
86
(.., subpatN-1, subpatN)
89
87
(subpat1, .., subpatN)
90
- // **NEW**: Tuple patterns, any position with a sublist binding.
91
- // The binding has a tuple type.
92
- // By ref bindings are not allowed, because layouts of (A, B, C, D) and (B, C) are not necessarily
93
- // compatible (e.g. field reordering is possible).
88
+ // **NOT PROPOSED**: Tuple patterns with bindings
94
89
(subpat1, binding.., subpatN)
90
+ ```
91
+
92
+ Slice patterns are not covered in this RFC, but here is the syntax for reference:
95
93
94
+ ```
96
95
// Slice patterns, the last position.
97
96
[subpat1, subpat2, ..]
98
97
// Slice patterns, the first position.
0 commit comments