mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
accidentally forgot about improvements if there were multiplie candidates
This commit is contained in:
parent
be7288303a
commit
216edbae59
3 changed files with 6 additions and 3 deletions
|
@ -23,7 +23,7 @@ regex_macros = { version = "0.1.33", optional = true }
|
|||
semver = "0.2.1"
|
||||
toml = "0.1"
|
||||
unicode-normalization = "0.1"
|
||||
quine-mc_cluskey = "0.2.1"
|
||||
quine-mc_cluskey = "0.2.2"
|
||||
|
||||
[dev-dependencies]
|
||||
compiletest_rs = "0.1.0"
|
||||
|
|
|
@ -275,7 +275,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
|
|||
return;
|
||||
}
|
||||
// if the number of occurrences of a terminal decreases or any of the stats decreases while none increases
|
||||
improvement = (stats.terminals[i] > simplified_stats.terminals[i]) ||
|
||||
improvement |= (stats.terminals[i] > simplified_stats.terminals[i]) ||
|
||||
(stats.negations > simplified_stats.negations && stats.ops == simplified_stats.ops) ||
|
||||
(stats.ops > simplified_stats.ops && stats.negations == simplified_stats.negations);
|
||||
}
|
||||
|
|
|
@ -77,5 +77,8 @@ fn equality_stuff() {
|
|||
//|~ SUGGESTION let _ = false;
|
||||
let _ = a > b && a == b;
|
||||
|
||||
let _ = a != b || !(a != b || c == d);
|
||||
let _ = a != b || !(a != b || c == d); //~ ERROR this boolean expression can be simplified
|
||||
//|~ HELP for further information visit
|
||||
//|~ SUGGESTION let _ = !c == d || a != b;
|
||||
//|~ SUGGESTION let _ = !(!a != b && c == d);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue