diff --git a/changelogs/unreleased/1015-dark64 b/changelogs/unreleased/1015-dark64 new file mode 100644 index 00000000..3db3ee4f --- /dev/null +++ b/changelogs/unreleased/1015-dark64 @@ -0,0 +1 @@ +Improve error message on unconstrained variable detection \ No newline at end of file diff --git a/zokrates_core/src/static_analysis/unconstrained_vars.rs b/zokrates_core/src/static_analysis/unconstrained_vars.rs index dcade683..52793cec 100644 --- a/zokrates_core/src/static_analysis/unconstrained_vars.rs +++ b/zokrates_core/src/static_analysis/unconstrained_vars.rs @@ -18,7 +18,7 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, - "Found unconstrained variables during IR analysis (found {} occurrence{})", + "Found unconstrained variables during IR analysis (found {} occurrence{}). If this is intentional, use the `--allow-unconstrained-variables` flag.", self.0, if self.0 == 1 { "" } else { "s" } ) @@ -86,7 +86,7 @@ mod tests { let result = UnconstrainedVariableDetector::detect(&p); assert_eq!( result.expect_err("expected an error").to_string(), - "Found unconstrained variables during IR analysis (found 1 occurrence)" + "Found unconstrained variables during IR analysis (found 1 occurrence). If this is intentional, use the `--allow-unconstrained-variables` flag." ); }