Auto merge of #10845 - disco07:master, r=giraffate
nonminimal_bool fix double not fix issue https://github.com/rust-lang/rust-clippy/issues/10836 changelog: Fix [`nonminimal_bool`] false positive when `!!x`, `x` isn't boolean and implements `Not`
This commit is contained in:
commit
e85869578d
2 changed files with 18 additions and 1 deletions
|
|
@ -110,3 +110,17 @@ fn issue_10435() {
|
|||
println!("{}", line!());
|
||||
}
|
||||
}
|
||||
|
||||
fn issue10836() {
|
||||
struct Foo(bool);
|
||||
impl std::ops::Not for Foo {
|
||||
type Output = bool;
|
||||
|
||||
fn not(self) -> Self::Output {
|
||||
!self.0
|
||||
}
|
||||
}
|
||||
|
||||
// Should not lint
|
||||
let _: bool = !!Foo(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue