From f8c5e10f266b45ecfbb603c165aca61144008c17 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 16 Jun 2019 14:47:01 +0200 Subject: [PATCH] Fix compiling in release mode --- src/abi.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/abi.rs b/src/abi.rs index e8523cd2de0..3c608a1d97c 100644 --- a/src/abi.rs +++ b/src/abi.rs @@ -716,8 +716,14 @@ pub fn codegen_call_inner<'a, 'tcx: 'a>( def: InstanceDef::Virtual(_, idx), .. }) => { - let nop_inst = fx.bcx.ins().nop(); - fx.add_comment(nop_inst, format!("virtual call; self arg pass mode: {:?}", get_pass_mode(fx.tcx, args[0].layout()))); + #[cfg(debug_assertions)] + { + let nop_inst = fx.bcx.ins().nop(); + fx.add_comment( + nop_inst, + format!("virtual call; self arg pass mode: {:?}", get_pass_mode(fx.tcx, args[0].layout())), + ); + } let (ptr, method) = crate::vtable::get_ptr_and_method_ref(fx, args[0], idx); (Some(method), Single(ptr), true) } @@ -727,8 +733,11 @@ pub fn codegen_call_inner<'a, 'tcx: 'a>( // Indirect call None => { - let nop_inst = fx.bcx.ins().nop(); - fx.add_comment(nop_inst, "indirect call"); + #[cfg(debug_assertions)] + { + let nop_inst = fx.bcx.ins().nop(); + fx.add_comment(nop_inst, "indirect call"); + } let func = trans_operand(fx, func.expect("indirect call without func Operand")) .load_scalar(fx); (