-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: Add syntaxic sugar for struct expressions fields from variables of the same name #11990
Labels
A-parser
Area: The parsing of Rust source code to an AST
Comments
4 tasks
OCaml has this. It's nice. I'd support it. |
Closed with [my comment] on #11994. |
Oh hm, no, I should leave this open. Today's meeting notes: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-02-11.md#binding-in-struct-patterns |
Triage bump. |
Shouldn't this have to go through the RFC process now? |
This issue has been moved to the RFCs repo: rust-lang/rfcs#306 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The general syntax for a struct pattern is:
But when the desired variable name is the same as the field name, it does not need to be repeated:
This proposal is to add similar syntax sugar for struct expressions:
… would be the same as:
CC: @eddyb
The text was updated successfully, but these errors were encountered: