+2018-03-19 Tom Tromey <tom@tromey.com>
+
+ * rust-exp.y (struct_expr_tail, struct_expr_list): Add plain
+ "IDENT" production.
+
2018-03-19 Pedro Alves <palves@redhat.com>
Tom Tromey <tom@tromey.com>
sf.init = $3;
$$ = sf;
}
+| IDENT
+ {
+ struct set_field sf;
+
+ sf.name = $1;
+ sf.init = ast_path ($1, NULL);
+ $$ = sf;
+ }
;
struct_expr_list:
$5->push_back (sf);
$$ = $5;
}
+| IDENT ',' struct_expr_list
+ {
+ struct set_field sf;
+
+ sf.name = $1;
+ sf.init = ast_path ($1, NULL);
+ $3->push_back (sf);
+ $$ = $3;
+ }
;
array_expr:
+2018-03-19 Tom Tromey <tom@tromey.com>
+
+ * gdb.rust/simple.rs (main): Add local variables field1, field2,
+ y0.
+ * gdb.rust/simple.exp: Test bare identifier form of struct
+ initializer.
+
2018-03-19 Tom Tromey <tom@tromey.com>
* gdb.gdb/observer.exp: Remove.
gdb_test "print nosuchsymbol" \
"No symbol 'nosuchsymbol' in current context"
+gdb_test "print simple::HiBob{field1, field2}" \
+ " = simple::HiBob \\{field1: 77, field2: 88\\}"
+
gdb_test "print e" " = simple::MoreComplicated::Two\\(73\\)"
gdb_test "print e2" \
" = simple::MoreComplicated::Four\\{this: true, is: 8, a: 109 'm', struct_: 100, variant: 10\\}"
let y = HiBob {field1: 7, field2: 8};
let z = ByeBob(7, 8);
+ let field1 = 77;
+ let field2 = 88;
+ let y0 = HiBob { field1, field2 };
+
let univariant = Univariant::Foo {a : 1};
let univariant_anon = UnivariantAnon::Foo(1);