@@ -79,6 +79,8 @@ S(.., subpatN-1, subpatN)
79
79
S(subpat1, .., subpatN)
80
80
// **NEW**: Tuple struct patterns, any position with a sublist binding.
81
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).
82
84
S(subpat1, binding.., subpatN)
83
85
84
86
// **NEW**: Tuple patterns, any position.
@@ -87,6 +89,8 @@ S(subpat1, binding.., subpatN)
87
89
(subpat1, .., subpatN)
88
90
// **NEW**: Tuple patterns, any position with a sublist binding.
89
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).
90
94
(subpat1, binding.., subpatN)
91
95
92
96
// Slice patterns, the last position.
@@ -96,6 +100,7 @@ S(subpat1, binding.., subpatN)
96
100
// Slice patterns, any other position.
97
101
[subpat1, .., subpatN]
98
102
// Slice patterns, any of the above with a subslice binding.
103
+ // By ref bindings are allowed, slices and subslices always have compatible layouts.
99
104
[subpat1, binding.., subpatN]
100
105
```
101
106
@@ -113,7 +118,7 @@ None.
113
118
# Alternatives
114
119
[ alternatives ] : #alternatives
115
120
116
- None .
121
+ Do not permit sublist bindings in tuples and tuple structs at all .
117
122
118
123
# Unresolved questions
119
124
[ unresolved ] : #unresolved-questions
0 commit comments