Update struct_expr grammar for field init shorthand.#38956
Update struct_expr grammar for field init shorthand.#38956bors merged 1 commit intorust-lang:masterfrom
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/doc/grammar.md
Outdated
There was a problem hiding this comment.
You mean it should be :
ident | ident ':' expr?
This might be a bit cleaner:
struct_expr_field_init : ident | ident ':' expr
struct_expr : expr_path '{' struct_expr_field_init
[ ',' struct_expr_field_init ] * There was a problem hiding this comment.
Braces are not balanced (and there’s the same mistake in the cleaner version as well). Extracting into struct_expr_field_init sounds like a good idea regardless. Makes it easier to read.
There was a problem hiding this comment.
Ah yeah, I obvisouly should have noticed that, I was a bit hasty. My bad.
Should be fixed now.
90b69c1 to
7620271
Compare
|
This LGTM. |
7620271 to
487ca5c
Compare
|
@bors: r+ rollup sorry for the tardiness here! |
|
📌 Commit 487ca5c has been approved by |
…nd-38830, r=steveklabnik Update struct_expr grammar for field init shorthand. Part of the work for rust-lang#38830 . r? @steveklabnik
Part of the work for #38830 .
r? @steveklabnik