]> git.lizzy.rs Git - rust.git/blob - tests/ui/unit_cmp.rs
Merge pull request #2984 from flip1995/single_char_pattern
[rust.git] / tests / ui / unit_cmp.rs
1
2
3
4 #![warn(unit_cmp)]
5 #![allow(no_effect, unnecessary_operation)]
6
7 #[derive(PartialEq)]
8 pub struct ContainsUnit(()); // should be fine
9
10 fn main() {
11     // this is fine
12     if true == false {
13     }
14
15     // this warns
16     if { true; } == { false; } {
17     }
18
19     if { true; } > { false; } {
20     }
21 }