Uh oh!
There was an error while loading. Please reload this page.
Implement .. in tuple (struct) patterns (RFC 1492) - #33639
Conversation
Since this implements an RfC, it will need to land soon, right? In that case, we probably should make a batch soon after this gets approved -- so if you have other PRs you want to make, now is the time! |
bors
commented
May 18, 2016
☔ The latest upstream changes (presumably #33654) made this pull request unmergeable. Please resolve the merge conflicts. |
petrochenkov
commented
May 18, 2016
Rebased. |
There was a problem hiding this comment.
Nit: s/presents/is present/
There was a problem hiding this comment.
Not that there is anything wrong with it, but I am surprised by this choice; I would have expected Vec<P<Pat>> and Option<Vec<P<Pat>>>, where the second set of patterns come after the ... Did you consider this and find that the current optional usize works out better (or just that you prefer it)? Anyway, it seems ok as is, just wanted to toss an alternative out there.
There was a problem hiding this comment.
One allocation, the variant itself is more compact (6 ptrs vs 4 ptrs), simpler traversal (no vec1.chain(vec2)).
nikomatsakis
commented
May 19, 2016
Looks good. r=me with the add'l tests listed and nits addressed, though we should decide whether |
petrochenkov
commented
May 21, 2016
Updated. |
aturon
commented
May 23, 2016
My vote: let's keep it illegal and thereby start conservatively. |
pnkfelix
commented
May 23, 2016
I concur with @aturon; plus both syntaxes are feature gated so even if change wasn't a conservative extension we would still be within bounds to change it later |
nikomatsakis
commented
May 23, 2016
OK. Seems weird to me to permit trailing commas but only sometimes, but I bow to the will of the masses! |
nikomatsakis
commented
May 23, 2016
@bors r+ |
bors
commented
May 23, 2016
📌 Commit 4983025 has been approved by |
Manishearth
commented
May 23, 2016
nikomatsakis
commented
May 23, 2016
D'oh, sorry @Manishearth
|
cc rust-lang#33627 r? @nikomatsakis plugin-[breaking-change] cc rust-lang#31645@Manishearth
cc rust-lang#33627 r? @nikomatsakis plugin-[breaking-change] cc rust-lang#31645@Manishearth
cc #33627
r? @nikomatsakis
plugin-[breaking-change] cc #31645@Manishearth