Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Implement .. in tuple (struct) patterns #32079

Closed
wants to merge 1 commit into from

Conversation

petrochenkov
Copy link
Contributor

An implementation for rust-lang/rfcs#1492
The sub-list bindings pat.. are not implemented.
The code needs some cleanup, but otherwise works.

@alexcrichton
Copy link
Member

r? @nikomatsakis

@alexcrichton
Copy link
Member

(just making sure some assignment is given, sounds like this should wait for the RFC to land though)

@bors
Copy link
Contributor

bors commented Mar 8, 2016

☔ The latest upstream changes (presumably #31954) made this pull request unmergeable. Please resolve the merge conflicts.

@arielb1
Copy link
Contributor

arielb1 commented Mar 8, 2016

Here match x { (..) => { /*..*/ } } when the type of x is unknown unifies x with a tuple of size 0. I would prefer to emit a "the type of this value must be known" error.

@petrochenkov
Copy link
Contributor Author

@arielb1
Hm, I thought I did exactly that. If tuple pattern contains .. then I call structurally_resolved_type to determine the expected tuple length and it requires the type of x to be known.

@arielb1
Copy link
Contributor

arielb1 commented Mar 8, 2016

Maybe I read the code wrong. Just be sure to add a test.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to resubmit with a rebase!

@alexcrichton
Copy link
Member

Oh right if this is waiting on rust-lang/rfcs#1492 I'm just trying to clear out the queue, but feel free to resubmit as soon as the RFC is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants