From 6b0eb107694aa07abf8a85e42b5991e9744b73eb Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 1 Apr 2016 21:24:26 +0530 Subject: [PATCH] Ignore pathological cases in boolean lint (#825) --- src/booleans.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/booleans.rs b/src/booleans.rs index 877a45a355a..37ad927ef92 100644 --- a/src/booleans.rs +++ b/src/booleans.rs @@ -294,6 +294,14 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> { cx: self.0, }; if let Ok(expr) = h2q.run(e) { + + if h2q.terminals.len() > 8 { + // QMC has exponentially slow behavior as the number of terminals increases + // 8 is reasonable, it takes approximately 0.2 seconds. + // See #825 + return; + } + let stats = terminal_stats(&expr); let mut simplified = expr.simplify(); for simple in Bool::Not(Box::new(expr.clone())).simplify() {