Replace if + panic! with assert!
@@ -462,20 +462,18 @@ impl<'a> FunctionBuilder<'a> {
#[cfg(debug_assertions)]
{
for (block, block_data) in self.func_ctx.blocks.iter() {
- if !(block_data.pristine || self.func_ctx.ssa.is_sealed(block)) {
- panic!(
+ assert!(
+ block_data.pristine || self.func_ctx.ssa.is_sealed(block),
"FunctionBuilder finalized, but block {} is not sealed",
- block
+ block,
);
- }
- if !(block_data.pristine || block_data.filled) {
- panic!(
+ assert!(
+ block_data.pristine || block_data.filled,
"FunctionBuilder finalized, but block {} is not filled",
- block
+ block,
);
}
}
- }
// In debug mode, check that all blocks are valid basic blocks.
#[cfg(debug_assertions)]
