Stream: t-compiler

Topic: Adt's Variant


RalfJ (Aug 07 2019 at 06:11, on Zulip):

https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.AdtDef.html#structfield.variants says "if this is a struct or enum, there will be a single variant". is that correct? I thought this represents the N variants of an enum?

RalfJ (Aug 07 2019 at 06:13, on Zulip):

relatedly, is there example code somewhere for how to get the list of field types out of a Tuple, or a struct? All I see is a bunch of subst stuff...

RalfJ (Aug 07 2019 at 06:14, on Zulip):

the docs of the "recovered" field of a variant are also extremely informative... they literally say "Recovered?"

RalfJ (Aug 07 2019 at 06:35, on Zulip):

relatedly, is there example code somewhere for how to get the list of field types out of a Tuple, or a struct? All I see is a bunch of subst stuff...

ah, found something

RalfJ (Aug 07 2019 at 06:35, on Zulip):

I might add a convenience method for tuples, this is not entirely trivial to discover

centril (Aug 07 2019 at 07:25, on Zulip):

I also read those docs and was confused; if you have time to make a docs PR that would be great

RalfJ (Aug 07 2019 at 08:08, on Zulip):

I'll fix the AdtDef thing as part of my zeroed-lint

RalfJ (Aug 07 2019 at 08:08, on Zulip):

I have no idea what the "recovered" field is or does so I cannot fix those docs

Esteban Küber (Aug 08 2019 at 17:27, on Zulip):

If you check git blame and it's mine it's a marker that there were errors during parsing this type, so don't complain about things like being unsized or missing arguments

Esteban Küber (Aug 08 2019 at 17:27, on Zulip):

But I'm fuzzy about the details and u try to have relevant comments when adding things like these

RalfJ (Aug 09 2019 at 08:15, on Zulip):

@Vadim Petrochenkov helped out and there is a more informative doc comment there now :)

Last update: Nov 16 2019 at 02:15UTC