It would be best to take advantage of the [`ElaborateDrops`](https://github.com/rust-lang/rust/blob/6b4511755cfe63a46f2db8c72145e07f94911c08/src/librustc_driver/driver.rs#L1054) MIR pass, which is currently run _after_ the `after_analysis` callback that Miri uses. I'm currently looking into adding a callback between `after_analysis` and `after_trans` for this purpose.