aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r--gdb/rust-lang.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 3deb525..481a4fc 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -294,7 +294,10 @@ rust_underscore_fields (struct type *type, int offset)
int
rust_tuple_struct_type_p (struct type *type)
{
- return rust_underscore_fields (type, 0);
+ /* This is just an approximation until DWARF can represent Rust more
+ precisely. We exclude zero-length structs because they may not
+ be tuple structs, and there's no way to tell. */
+ return TYPE_NFIELDS (type) > 0 && rust_underscore_fields (type, 0);
}
/* Return true if a variant TYPE is a tuple variant, false otherwise. */