@@ -674,16 +683,41 @@ rust_print_struct_def (struct type *type, const
char *varstring,
if (TYPE_NFIELDS (type) == 0 && !is_tuple)
return;
- if (for_rust_enum)
+ if (for_rust_enum && !flags->print_offsets)
fputs_filtered (is_tuple_struct ? "(" : "{", stream);
else
fputs_filtered (is_tuple_struct ? " (\n" : " {\n", stream);
+ // When printing offsets, we rearrange the fields into storage
+ // order. This lets us show holes more clearly. We work using
+ // field indices here because it simplifies calls to
+ // print_offset_data::update below.