binutils-gdb/gdb/testsuite/gdb.rust
Tom Tromey 926300415b Support bare-identifier field initializers in Rust
In Rust one can initialize a struct member from an identically-named
local variable by simply mentioning the member name in the
initializer, like:

    let x = 0;
    let y = Struct { x };

This initializes "Struct::x" from "x".

This patch adds this form of initializer to the Rust expression parser
and adds a test.

Tested on x86-64 Fedora 26 using rustc 1.23.

2018-03-19  Tom Tromey  <tom@tromey.com>

	* rust-exp.y (struct_expr_tail, struct_expr_list): Add plain
	"IDENT" production.

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 11:01:31 -06:00
..
expr.exp Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
generics.exp Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
generics.rs Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
methods.exp Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
methods.rs Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
modules.exp Fix qualified name lookup for Rust 2018-01-19 15:30:28 -07:00
modules.rs Fix qualified name lookup for Rust 2018-01-19 15:30:28 -07:00
simple.exp Support bare-identifier field initializers in Rust 2018-03-19 11:01:31 -06:00
simple.rs Support bare-identifier field initializers in Rust 2018-03-19 11:01:31 -06:00
traits.exp Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
traits.rs Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
unsized.exp Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
unsized.rs Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
watch.exp Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
watch.rs Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00