Skip to content

Commit f8c5e10

Browse files
committed
Fix compiling in release mode
1 parent 5b70fd6 commit f8c5e10

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/abi.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,14 @@ pub fn codegen_call_inner<'a, 'tcx: 'a>(
716716
def: InstanceDef::Virtual(_, idx),
717717
..
718718
}) => {
719-
let nop_inst = fx.bcx.ins().nop();
720-
fx.add_comment(nop_inst, format!("virtual call; self arg pass mode: {:?}", get_pass_mode(fx.tcx, args[0].layout())));
719+
#[cfg(debug_assertions)]
720+
{
721+
let nop_inst = fx.bcx.ins().nop();
722+
fx.add_comment(
723+
nop_inst,
724+
format!("virtual call; self arg pass mode: {:?}", get_pass_mode(fx.tcx, args[0].layout())),
725+
);
726+
}
721727
let (ptr, method) = crate::vtable::get_ptr_and_method_ref(fx, args[0], idx);
722728
(Some(method), Single(ptr), true)
723729
}
@@ -727,8 +733,11 @@ pub fn codegen_call_inner<'a, 'tcx: 'a>(
727733

728734
// Indirect call
729735
None => {
730-
let nop_inst = fx.bcx.ins().nop();
731-
fx.add_comment(nop_inst, "indirect call");
736+
#[cfg(debug_assertions)]
737+
{
738+
let nop_inst = fx.bcx.ins().nop();
739+
fx.add_comment(nop_inst, "indirect call");
740+
}
732741
let func = trans_operand(fx, func.expect("indirect call without func Operand"))
733742
.load_scalar(fx);
734743
(

0 commit comments

Comments
 (0)