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. */