[meta] Give a nicer error message when a legalization uses an incorrect number of arguments
This commit is contained in:
@@ -183,7 +183,12 @@ fn rewrite_expr(
|
||||
assert_eq!(
|
||||
apply_target.inst().operands_in.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();
|
||||
|
||||
Reference in New Issue
Block a user