Add unreachable comments.

This commit is contained in:
Stephen Chung
2022-07-23 21:00:58 +08:00
parent f85ad28e93
commit e8d6e3f57d
5 changed files with 8 additions and 8 deletions

View File

@@ -895,7 +895,7 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut OptimizerState, preserve_result: b
*stmt = stmt_block.into();
}
Expr::Stmt(..) => *stmt = Stmt::Noop(expr.position()),
_ => unreachable!(),
_ => unreachable!("`Expr::Stmt`"),
}
}
@@ -950,7 +950,7 @@ fn optimize_expr(expr: &mut Expr, state: &mut OptimizerState, _chaining: bool) {
optimize_expr(&mut e, state, false);
*expr = *e;
}
_ => unreachable!()
_ => unreachable!("`Expr::Stmt`")
}
}
// { stmt; ... } - do not count promotion as dirty because it gets turned back into an array