Parse tuple struct field initialization

This commit is contained in:
Evgenii P 2019-08-09 15:38:52 +07:00
parent 2fbec23d99
commit 957b5ed23a
4 changed files with 31 additions and 8 deletions

View file

@ -572,6 +572,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) {
// S {};
// S { x, y: 32, };
// S { x, y: 32, ..Default::default() };
// TupleStruct { 0: 1 };
// }
pub(crate) fn named_field_list(p: &mut Parser) {
assert!(p.at(T!['{']));
@ -583,7 +584,7 @@ pub(crate) fn named_field_list(p: &mut Parser) {
// fn main() {
// S { #[cfg(test)] field: 1 }
// }
IDENT | T![#] => {
IDENT | INT_NUMBER | T![#] => {
let m = p.start();
attributes::outer_attributes(p);
name_ref(p);