Skip to content

Commit fb5b0d0

Browse files
authored
Rollup merge of rust-lang#38956 - theduke:document-field-init-shorthand-38830, r=steveklabnik
Update struct_expr grammar for field init shorthand. Part of the work for rust-lang#38830 . r? @steveklabnik
2 parents 12b4629 + 487ca5c commit fb5b0d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/doc/grammar.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,9 @@ unit_expr : "()" ;
510510
### Structure expressions
511511

512512
```antlr
513-
struct_expr : expr_path '{' ident ':' expr
514-
[ ',' ident ':' expr ] *
513+
struct_expr_field_init : ident | ident ':' expr ;
514+
struct_expr : expr_path '{' struct_expr_field_init
515+
[ ',' struct_expr_field_init ] *
515516
[ ".." expr ] '}' |
516517
expr_path '(' expr
517518
[ ',' expr ] * ')' |

0 commit comments

Comments
 (0)