]> git.lizzy.rs Git - rust.git/blob - tests/ui/unit_cmp.rs
Auto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995
[rust.git] / tests / ui / unit_cmp.rs
1 #![warn(clippy::unit_cmp)]
2 #![allow(clippy::no_effect, clippy::unnecessary_operation)]
3
4 #[derive(PartialEq)]
5 pub struct ContainsUnit(()); // should be fine
6
7 fn main() {
8     // this is fine
9     if true == false {}
10
11     // this warns
12     if {
13         true;
14     } == {
15         false;
16     } {}
17
18     if {
19         true;
20     } > {
21         false;
22     } {}
23 }