Skip to content

Commit 4b5bb33

Browse files
committed
Pretty print non local mir bodies too on panic
1 parent 137bfd0 commit 4b5bb33

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/driver.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ pub fn codegen_crate<'a, 'tcx>(
4848
fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, log: &mut Option<File>) -> ! {
4949
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
5050

51-
let mut jit_module: Module<SimpleJITBackend> =
52-
Module::new(SimpleJITBuilder::new(cranelift_module::default_libcall_names()));
51+
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new(
52+
cranelift_module::default_libcall_names(),
53+
));
5354
assert_eq!(pointer_ty(tcx), jit_module.target_config().pointer_type());
5455

5556
let sig = Signature {
@@ -115,9 +116,9 @@ fn run_aot<'a, 'tcx: 'a>(
115116
};
116117

117118
let emit_module = |name: &str,
118-
kind: ModuleKind,
119-
mut module: Module<FaerieBackend>,
120-
debug: Option<DebugContext>| {
119+
kind: ModuleKind,
120+
mut module: Module<FaerieBackend>,
121+
debug: Option<DebugContext>| {
121122
module.finalize_definitions();
122123
let mut artifact = module.finish().artifact;
123124

@@ -251,9 +252,7 @@ fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
251252
match inst.def {
252253
InstanceDef::Item(_)
253254
| InstanceDef::DropGlue(_, _)
254-
| InstanceDef::Virtual(_, _)
255-
if inst.def_id().krate == LOCAL_CRATE =>
256-
{
255+
| InstanceDef::Virtual(_, _) => {
257256
let mut mir = ::std::io::Cursor::new(Vec::new());
258257
crate::rustc_mir::util::write_mir_pretty(
259258
tcx,

0 commit comments

Comments
 (0)