Skip to content

Allow trailing commas in array patterns and attributes #19413

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

Merged
merged 1 commit into from
Dec 5, 2014

Conversation

ftxqxd
Copy link
Contributor

@ftxqxd ftxqxd commented Nov 30, 2014

The only other place I know of that doesn’t allow trailing commas is closure types (#19414), and those are a bit tricky to fix (I suspect it might be impossible without infinite lookahead) so I didn’t implement that in this patch. There are other issues surrounding closure type parsing anyway, in particular #19410.

@alexcrichton
Copy link
Member

It seems ok to parse trailing commas, but trailing commas in some array patterns seems unusual in that they allow a trailing comma after the ... Struct patterns, for example, do not allow trailing commas. Would it be possible to not allow a trailing comma after the ..?

@ftxqxd ftxqxd force-pushed the more-trailing-commas branch from 272b3c0 to f5715f7 Compare November 30, 2014 09:29
@ftxqxd
Copy link
Contributor Author

ftxqxd commented Nov 30, 2014

@alexcrichton OK, I’ve made trailing commas directly after ..s in patterns a syntax error. r?

@alexcrichton alexcrichton merged commit f5715f7 into rust-lang:master Dec 5, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 28, 2025
fix: Properly calculate the layouts of tuple ptrs whose last fields are DST
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.

3 participants