Fix break on Python 2
[deliverable/binutils-gdb.git] / gdb / rust-lang.c
index a8048242860c7c1d6d588f7927dd2f23cb2b0cfb..4977b0a1aa3f04b18e8e6179915b9898156cb75e 100644 (file)
@@ -124,7 +124,6 @@ rust_get_disr_info (struct type *type, const gdb_byte *valaddr,
   struct disr_info ret;
   struct type *disr_type;
   struct value_print_options opts;
-  struct cleanup *cleanup;
   const char *name_segment;
 
   get_no_prettyformat_print_options (&opts);
@@ -977,6 +976,8 @@ rust_print_type (struct type *type, const char *varstring,
                skip_to = 0;
              }
          }
+       else if (TYPE_NFIELDS (type) == 1)
+         skip_to = 0;
 
        for (i = 0; i < TYPE_NFIELDS (type); ++i)
          {
@@ -989,7 +990,9 @@ rust_print_type (struct type *type, const char *varstring,
            if (TYPE_NFIELDS (variant_type) > skip_to)
              {
                int first = 1;
-               bool is_tuple = rust_tuple_variant_type_p (variant_type);
+               bool is_tuple = (TYPE_NFIELDS (type) == 1
+                                ? rust_tuple_struct_type_p (variant_type)
+                                : rust_tuple_variant_type_p (variant_type));
                int j;
 
                fputs_filtered (is_tuple ? "(" : "{", stream);
This page took 0.024117 seconds and 4 git commands to generate.