Skip to content

Commit

Permalink
fix: Show println output before an error occurs in nargo execute (#…
Browse files Browse the repository at this point in the history
…3211)

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
  • Loading branch information
3 people authored Oct 23, 2023
1 parent 22f4930 commit 2f0b80d
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,20 +427,10 @@ impl AcirContext {
let diff_expr = &lhs_expr - &rhs_expr;

// Check to see if equality can be determined at compile-time.
if diff_expr.is_const() {
if diff_expr.is_zero() {
// Constraint is always true - assertion is unnecessary.
self.mark_variables_equivalent(lhs, rhs)?;
return Ok(());
} else {
// Constraint is always false - this program is unprovable.
return Err(RuntimeError::FailedConstraint {
lhs: Box::new(lhs_expr),
rhs: Box::new(rhs_expr),
call_stack: self.get_call_stack(),
assert_message,
});
};
if diff_expr.is_zero() {
// Constraint is always true - assertion is unnecessary.
self.mark_variables_equivalent(lhs, rhs)?;
return Ok(());
}

self.acir_ir.assert_is_zero(diff_expr);
Expand Down

0 comments on commit 2f0b80d

Please sign in to comment.