rust-clippy/tests/ui/unit_cmp.rs
2019-01-08 21:46:39 +01:00

23 lines
350 B
Rust

#![warn(clippy::unit_cmp)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
#[derive(PartialEq)]
pub struct ContainsUnit(()); // should be fine
fn main() {
// this is fine
if true == false {}
// this warns
if {
true;
} == {
false;
} {}
if {
true;
} > {
false;
} {}
}