mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
24 lines
350 B
Rust
24 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;
|
|
} {}
|
|
}
|