1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

Merge pull request #1015 from Zokrates/dark64-patch-3

Improve error message on unconstrained variable detection
This commit is contained in:
Thibaut Schaeffer 2021-09-27 10:16:18 +03:00 committed by GitHub
commit 9a4d6e4c80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1 @@
Improve error message on unconstrained variable detection

View file

@ -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."
);
}