[meta] Give a nicer error message when a legalization uses an incorrect number of arguments

This commit is contained in:
bjorn3
2019-06-29 16:22:31 +02:00
committed by Dan Gohman
parent 8d0e8f8931
commit a43a3a5e9f

View File

@@ -183,7 +183,12 @@ fn rewrite_expr(
assert_eq!( assert_eq!(
apply_target.inst().operands_in.len(), apply_target.inst().operands_in.len(),
dummy_args.len(), dummy_args.len(),
"number of arguments in instruction is incorrect" "number of arguments in instruction {} is incorrect\nexpected: {:?}",
apply_target.inst().name,
apply_target.inst().operands_in
.iter()
.map(|operand| format!("{}: {}", operand.name, operand.kind.name))
.collect::<Vec<_>>(),
); );
let mut args = Vec::new(); let mut args = Vec::new();