diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 49c0fa34340..b2a83e1d4eb 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -7,7 +7,7 @@ macro_rules! intrinsic_args { let ($($arg),*) = if let [$($arg),*] = $args { ($(codegen_operand($fx, $arg)),*) } else { - bug!("wrong number of args for intrinsic {}", $intrinsic); + $crate::intrinsics::bug_on_incorrect_arg_count($intrinsic); }; } } @@ -26,6 +26,10 @@ macro_rules! intrinsic_args { use crate::prelude::*; use cranelift_codegen::ir::AtomicRmwOp; +fn bug_on_incorrect_arg_count(intrinsic: impl std::fmt::Display) -> ! { + bug!("wrong number of args for intrinsic {}", intrinsic); +} + fn report_atomic_type_validation_error<'tcx>( fx: &mut FunctionCx<'_, '_, 'tcx>, intrinsic: Symbol,