You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to what Oğuz did in rust-lang/rust#115534, indexed types should have debug methods that prints out more useful information like the name of the definition/variant/field.
As mentioned in rust-lang/rust#117517 (comment), this kind of debug printing is likely not possible for ProjectionElem until AdtDef is implemented in Stable MIR. Place::ty may also need to be implemented first to easily resolve the name of a variant/field. This is because it may be easiest to create a copy of the Place definition with the projection elements truncated to either the desired Downcast/Field projection or its parent, and then just call the Place::ty function to get the appropriate AdtDef.
The text was updated successfully, but these errors were encountered:
Yeah I think it should be unblocked now. I unfortunately have a few other things on my plate to take care of first, but ideally can take a stab at this in the next couple of weeks.
Okay, it seems that I am missing something, I can't see how the implementation of Place:ty can be used to retrieve the parent of an element. If all you have is local information, e.g. source relative index as in Downcast, how can Place::ty be used to retrieve the parent ADT?
Similar to what Oğuz did in rust-lang/rust#115534, indexed types should have debug methods that prints out more useful information like the name of the definition/variant/field.
As mentioned in rust-lang/rust#117517 (comment), this kind of debug printing is likely not possible for ProjectionElem until
AdtDef
is implemented in Stable MIR.Place::ty
may also need to be implemented first to easily resolve the name of a variant/field. This is because it may be easiest to create a copy of thePlace
definition with the projection elements truncated to either the desiredDowncast
/Field
projection or its parent, and then just call thePlace::ty
function to get the appropriateAdtDef
.The text was updated successfully, but these errors were encountered: