-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement richer debug information for ProjectionElem #53
Comments
I believe this issue is unblocked now sice we have implemented |
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. |
@rustbot claim |
This looks simple enough, unless I am missing something it's just a matter of adding all the variants of the enum, no? |
Okay, it seems that I am missing something, I can't see how the implementation of |
First off, my apologies for the severe delay in any response/work on this issue. @m-rph yeah we'd need more than just local
However, I don't think a standalone method like this is very useful. It's better just to integrate it with the existing stable mir debug/pretty-printing functionality. @celinval, I've been out of the loop for a while so I'm not clear on the best place to add in the symbol for variant projections. It looks like the debug implementation for |
I went back to the original comment on this, I think we should either close this issue or add the utility function We have implemented |
I was thinking that the best resolution for this issue is probably to update Additionally, the utility function I mentioned above is easy enough to implement in the future if it's needed and the place's type information is available. |
Sounds good to me! Thanks |
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: