2019-10-03 15:45:58 +00:00
|
|
|
#![warn(clippy::suspicious_unary_op_formatting)]
|
2023-07-02 12:35:19 +00:00
|
|
|
#![allow(clippy::needless_if)]
|
2019-10-03 15:45:58 +00:00
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
fn main() {
|
|
|
|
// weird binary operator formatting:
|
|
|
|
let a = 42;
|
|
|
|
|
|
|
|
if a >- 30 {}
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: by not having a space between `>` and `-` it looks like `>-` is a single o
|
2019-10-03 15:45:58 +00:00
|
|
|
if a >=- 30 {}
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: by not having a space between `>=` and `-` it looks like `>=-` is a single
|
2019-10-03 15:45:58 +00:00
|
|
|
|
|
|
|
let b = true;
|
|
|
|
let c = false;
|
|
|
|
|
|
|
|
if b &&! c {}
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: by not having a space between `&&` and `!` it looks like `&&!` is a single
|
2019-10-03 15:45:58 +00:00
|
|
|
|
|
|
|
if a >- 30 {}
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: by not having a space between `>` and `-` it looks like `>-` is a single o
|
2019-10-03 15:45:58 +00:00
|
|
|
|
|
|
|
// those are ok:
|
|
|
|
if a >-30 {}
|
|
|
|
if a < -30 {}
|
|
|
|
if b && !c {}
|
|
|
|
if a > - 30 {}
|
|
|
|
}
|