Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show println output before an error occurs in nargo execute #3211

Merged
merged 5 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_const() && diff_expr.is_zero() {
jfecher marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading