-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
-Zdump-mir does not dump all the MIR: drop glue missing #53532
Comments
From Zulip:
|
I got started on this, wrote https://github.com/RalfJung/rust/commits/mir-shim-dump/. Now it tries to dump MIR for shims. The problem is, in rust/src/librustc_mir/util/pretty.rs Lines 196 to 198 in dae6c93
we call |
@RalfJung Use the method on |
@eddyb Thanks! Now it gets a bit further and panics at rust/src/librustc_mir/util/pretty.rs Lines 571 to 573 in dae6c93
because, well, this is not a local node. I wonder if I should approach this differently -- special case the drop shim for printing? |
I'd say it's worth fixing these. Instead of checking the body owner kind, could it check |
Dumping MIR of another crate works now. However, MIR dumping expects to dump polymorphic MIR, meaning (a) all drop shims get the same filename, overwriting one another, and (b) in the dumped MIR, you cannot even see which type this is dropping. I guess I have to adjust |
@RalfJung What about appending instead of overwriting if the file is one that was created by the current MIR dumping? (i.e. by keeping a set of used file names) |
That sounds like a real bad hack. :/ Not to mention that it'd require some global state. |
Oh the printing is a side-effect of building MIR? Oops, I forgot. |
I hear @matthewjasper has a branch where dumping shims at least somewhat works. Could you point me to that branch? (EDIT: It's https://github.com/matthewjasper/rust/tree/dump-mir-shims) |
I rebased the branch to see if I can make some more progress, but what used to work doesn't work any more. I am now getting a panic in this line when dumping the MIR for Any idea why that |
Ah, turns out this Cc @oli-obk |
Ah I got something, it's all in https://github.com/RalfJung/rust/commits/mir-shim-dump/. I also extended |
There seems to be no way currently to dump at least some of the MIR that rustc generates itself, e.g. for drop.
In the following code
I can clearly see miri execute an
Offset
binop (a binop which is only ever emitted by the auto-generated drop glue), but grepping the entire dump directory forOffset
shows no hit.The text was updated successfully, but these errors were encountered: