Auto merge of #13209 - Alexendoo:nonminimal-bool-limit-ops, r=y21
Limit number of `nonminimal_bool` ops Fixes https://github.com/rust-lang/rust-clippy/issues/11257 Fixes https://github.com/rust-lang/rust-clippy/issues/13206 changelog: none
This commit is contained in:
commit
8dd459d4c7
2 changed files with 10 additions and 6 deletions
|
|
@ -477,14 +477,12 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
|
|||
cx: self.cx,
|
||||
};
|
||||
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
|
||||
let stats = terminal_stats(&expr);
|
||||
if stats.ops > 7 {
|
||||
// QMC has exponentially slow behavior as the number of ops increases.
|
||||
// See #825, #13206
|
||||
return;
|
||||
}
|
||||
|
||||
let stats = terminal_stats(&expr);
|
||||
let mut simplified = expr.simplify();
|
||||
for simple in Bool::Not(Box::new(expr)).simplify() {
|
||||
match simple {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue