@@ -17,7 +17,9 @@ be seen as just a tuple with N elements. The syntax is thus built around allowin
17
17
types into their components, and taking multiple types that will be condensed into a tuple.
18
18
19
19
For using these types, it is proposed that one destructure the tuple, generally into a single head, and the remaining
20
- tail. This matches the recursive style used in C++.
20
+ tail. This matches the recursive style used in C++. There is also some desire to
21
+ be able to iterate in both directions (from left or right) rather than fixing
22
+ the choice to a single direction.
21
23
22
24
### Pros
23
25
@@ -28,9 +30,11 @@ tail. This matches the recursive style used in C++.
28
30
### Cons
29
31
30
32
- Mentioned by eddyb, a subtuple type could have different padding than its parent.
31
- EG: ` &(A, B, C, D) != &A, &(B, C, D) `
33
+ EG: ` &(A, B, C, D) != &A, &(B, C, D) `
32
34
33
35
- The ` .. ` syntax is already used in ranges, so some other syntax would be needed
36
+ - Note that ` ... ` syntax may be available, as ` ..= ` is now the inclusive
37
+ range syntax.
34
38
35
39
### Syntax
36
40
@@ -65,7 +69,7 @@ The trait would contain helpful types and methods for working with variadic tupl
65
69
66
70
### Cons
67
71
68
- - Overlaps with inclusive range syntax, though it shouldn't actually break any backwards compatibility
72
+ - None yet.
69
73
70
74
### Syntax
71
75
@@ -131,3 +135,12 @@ all new functionality on top of that idea.
131
135
The overlap with range is a common topic of discussion, but all full proposals seem to still use that syntax.
132
136
Overall, the basic syntax seems to be agreed on, but usability and 'extra' ergonomic functionality still requires
133
137
a lot of work.
138
+
139
+ ## Tuple layout
140
+
141
+ Another important consideration for these proposals, particularly those resting
142
+ on tuples, is the layout of the tuple. We do not currently guarantee any
143
+ particular ordering of the fields in a tuple, which can limit our ability to
144
+ "subset" the tuple under a reference. See [ this
145
+ comment] ( https://github.com/rust-lang/lang-team/pull/76#issuecomment-857206830 )
146
+ for some discussion.
0 commit comments