ifs_same_cond bails out on equal methods that return bool #10272
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Uh oh!
There was an error while loading. Please reload this page.
Summary
apparently we detect boolan expressions of the form
x == y
but we don't detectfn(&self) -> bool
ones???I get it that this can be iffy if sideeffects are involved but in this example the fn does not even need
&mut self
:/Could we somehow warn here for const-fns at least maybe?
Lint Name
ifs_same_cond
Reproducer
I tried this code:
I expected to see this happen:
clippy warning
Instead, this happened:
Version
The text was updated successfully, but these errors were encountered: