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
generics.exp
generics.rs
methods.exp
methods.rs
modules.exp
modules.rs
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
traits.rs
unsized.exp
unsized.rs
watch.exp
watch.rs