diff options
author | Tom Tromey <tom@tromey.com> | 2018-09-13 10:56:34 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-09-13 10:57:40 -0600 |
commit | 4a3fe98f885a2d1db804584e7ea265ab3ccef4d7 (patch) | |
tree | 26d5b44bfa4d40c4358b4b78b65f57e5552ae2ea /gdb/rust-lang.c | |
parent | 098b2108a2b61531c0bc8ea16854f773083a95d7 (diff) | |
download | gdb-4a3fe98f885a2d1db804584e7ea265ab3ccef4d7.zip gdb-4a3fe98f885a2d1db804584e7ea265ab3ccef4d7.tar.gz gdb-4a3fe98f885a2d1db804584e7ea265ab3ccef4d7.tar.bz2 |
Make Rust error message mention the field name
I noticed a spot in rust-lang.c where the placeholder "foo" was used
instead of the actual field name. This patch fixes the bug.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
PR rust/23650:
* rust-lang.c (rust_evaluate_subexp): Use field name, not "foo".
gdb/testsuite/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
PR rust/23650:
* gdb.rust/simple.exp: Add test for enum field access error.
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r-- | gdb/rust-lang.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index b777389..43db722 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1726,9 +1726,9 @@ tuple structs, and tuple-like enum variants")); struct type *outer_type = type; type = value_type (lhs); if (rust_tuple_type_p (type) || rust_tuple_struct_type_p (type)) - error (_("Attempting to access named field foo of tuple " + error (_("Attempting to access named field %s of tuple " "variant %s::%s, which has only anonymous fields"), - TYPE_NAME (outer_type), + field_name, TYPE_NAME (outer_type), rust_last_path_segment (TYPE_NAME (type))); TRY |