rust/tests/ui/suspicious_unary_op_formatting.rs

25 lines
381 B
Rust
Raw Normal View History

#![warn(clippy::suspicious_unary_op_formatting)]
2023-06-10 06:43:30 -05:00
#![allow(clippy::needless_if)]
#[rustfmt::skip]
fn main() {
// weird binary operator formatting:
let a = 42;
if a >- 30 {}
if a >=- 30 {}
let b = true;
let c = false;
if b &&! c {}
if a >- 30 {}
// those are ok:
if a >-30 {}
if a < -30 {}
if b && !c {}
if a > - 30 {}
}