Use debug_assert_eq rather than debug_assert with an ==.
This commit is contained in:
@@ -319,8 +319,9 @@ where
|
|||||||
/// Register a new definition of a user variable. Panics if the type of the value is not the
|
/// Register a new definition of a user variable. Panics if the type of the value is not the
|
||||||
/// same as the type registered for the variable.
|
/// same as the type registered for the variable.
|
||||||
pub fn def_var(&mut self, var: Variable, val: Value) {
|
pub fn def_var(&mut self, var: Variable, val: Value) {
|
||||||
debug_assert!(
|
debug_assert_eq!(
|
||||||
self.func.dfg.value_type(val) == self.builder.types[var],
|
self.func.dfg.value_type(val),
|
||||||
|
self.builder.types[var],
|
||||||
"the type of the value is not the type registered for the variable"
|
"the type of the value is not the type registered for the variable"
|
||||||
);
|
);
|
||||||
self.builder.ssa.def_var(
|
self.builder.ssa.def_var(
|
||||||
@@ -557,8 +558,9 @@ where
|
|||||||
// The Ebb already has predecessors
|
// The Ebb already has predecessors
|
||||||
// We check that the arguments supplied match those supplied
|
// We check that the arguments supplied match those supplied
|
||||||
// previously.
|
// previously.
|
||||||
debug_assert!(
|
debug_assert_eq!(
|
||||||
jump_args.len() == self.builder.ebbs[dest_ebb].user_arg_count,
|
jump_args.len(),
|
||||||
|
self.builder.ebbs[dest_ebb].user_arg_count,
|
||||||
"the jump instruction doesn't have the same \
|
"the jump instruction doesn't have the same \
|
||||||
number of arguments as its destination Ebb \
|
number of arguments as its destination Ebb \
|
||||||
({} vs {}).",
|
({} vs {}).",
|
||||||
|
|||||||
Reference in New Issue
Block a user