This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] Fix handling of discriminantless univariant enums in Rust
>>>>> "Tom" == Tom Tromey <email@example.com> writes:
Tom> Also, I suspect this will wind up doing the wrong thing in the
Tom> STRUCTOP_ANONYMOUS case in rust_evaluate_subexp. In particular I wonder
Tom> if an additional "print univariant.0.a" test will work correctly?
Oh duh, I see that this isn't a correct counter-example.
What about just "print univariant.a"?
It seems to me that this will hit this:
start = disr.is_encoded ? 0 : 1;
... choosing 1 here, but:
for (i = start; i < TYPE_NFIELDS (variant_type); i++)
... failing this because TYPE_NFIELDS == 1; and then:
if (i == TYPE_NFIELDS (variant_type))
/* We didn't find it. */
error(_("Could not find field %s of struct variant %s"),