cleanup
This commit is contained in:
parent
302f561993
commit
018e5bf29e
2 changed files with 6 additions and 5 deletions
|
@ -610,17 +610,18 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> {
|
|||
|
||||
Ok(statements)
|
||||
}
|
||||
TypedStatement::Assertion(e, s) => {
|
||||
TypedStatement::Assertion(e, metadata) => {
|
||||
let e_str = e.to_string();
|
||||
let expr = self.fold_boolean_expression(e)?;
|
||||
match expr {
|
||||
BooleanExpression::Value(v) if !v => Err(Error::AssertionFailed(format!(
|
||||
"{}: ({})",
|
||||
s.map(|m| m.to_string())
|
||||
metadata
|
||||
.map(|m| m.to_string())
|
||||
.unwrap_or_else(|| "Assertion failed".to_string()),
|
||||
e_str,
|
||||
))),
|
||||
_ => Ok(vec![TypedStatement::Assertion(expr, s)]),
|
||||
_ => Ok(vec![TypedStatement::Assertion(expr, metadata)]),
|
||||
}
|
||||
}
|
||||
s @ TypedStatement::PushCallLog(..) => Ok(vec![s]),
|
||||
|
|
|
@ -531,7 +531,7 @@ impl<'ast, T: Field> Folder<'ast, T> for UintOptimizer<'ast, T> {
|
|||
}
|
||||
}
|
||||
}
|
||||
ZirStatement::Assertion(BooleanExpression::UintEq(box left, box right), m) => {
|
||||
ZirStatement::Assertion(BooleanExpression::UintEq(box left, box right), metadata) => {
|
||||
let left = self.fold_uint_expression(left);
|
||||
let right = self.fold_uint_expression(right);
|
||||
|
||||
|
@ -541,7 +541,7 @@ impl<'ast, T: Field> Folder<'ast, T> for UintOptimizer<'ast, T> {
|
|||
|
||||
vec![ZirStatement::Assertion(
|
||||
BooleanExpression::UintEq(box left, box right),
|
||||
m,
|
||||
metadata,
|
||||
)]
|
||||
}
|
||||
s => fold_statement(self, s),
|
||||
|
|
Loading…
Reference in a new issue