fix cross-crate destructor inlining

Closes #7793