Skip to content

Commit 08160bf

Browse files
committed
Use format format for Conv
1 parent 859e569 commit 08160bf

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/tools/miri/src/helpers.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -920,25 +920,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
920920

921921
/// Check that the ABI is what we expect.
922922
fn check_abi<'a>(&self, fn_abi: &FnAbi<'tcx, Ty<'tcx>>, exp_abi: Conv) -> InterpResult<'a, ()> {
923-
let caller_abi_name = match fn_abi.conv {
924-
Conv::C => "C",
925-
Conv::Rust => "Rust",
926-
Conv::X86Stdcall => "X86Stdcall",
927-
_ => { panic!("Unsupported caller ABI");}
928-
};
929-
let callee_abi_name = match exp_abi {
930-
Conv::C => "C",
931-
Conv::Rust => "Rust",
932-
Conv::X86Stdcall => "X86Stdcall",
933-
_ => { panic!("Unsupported callee ABI");}
934-
};
935-
936923
if fn_abi.conv != exp_abi {
937924
throw_ub_format!(
938925
"calling a function with ABI {} using caller ABI {}",
939-
callee_abi_name,
940-
caller_abi_name
941-
)
926+
format!("{:?}", exp_abi),
927+
format!("{:?}", fn_abi.conv)
928+
);
942929
}
943930
interp_ok(())
944931
}

0 commit comments

Comments
 (0)