From 2b89caf2c68bb00eb57100d99320fd63e68b041d Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 9 May 2023 17:38:03 +0200 Subject: [PATCH] Format affine expression in error. --- executor/src/witgen/affine_expression.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/executor/src/witgen/affine_expression.rs b/executor/src/witgen/affine_expression.rs index 16de7bf2b..c8c52a53a 100644 --- a/executor/src/witgen/affine_expression.rs +++ b/executor/src/witgen/affine_expression.rs @@ -66,7 +66,12 @@ where .iter() .filter_map(|(i, c)| (!c.is_zero()).then_some((*i, c))) } +} +impl<'x, K> AffineExpression +where + K: Copy + Ord + Display + 'x, +{ /// If the affine expression has only a single variable (with nonzero coefficient), /// returns the index of the variable and the assignment that evaluates the /// affine expression to zero. @@ -115,7 +120,7 @@ where // Try to solve directly. match self.solve() { Ok(value) if value.is_complete() => return Ok(value), - Err(()) => return Err(ConstraintUnsatisfiable(String::new())), + Err(()) => return Err(ConstraintUnsatisfiable(self.to_string())), Ok(value) => { // sanity check that we are not ignoring anything useful here assert!(value.constraints.is_empty());