2018-07-28 17:34:52 +02:00
|
|
|
#[warn(clippy::double_neg)]
|
2021-07-20 23:23:22 -04:00
|
|
|
#[allow(clippy::no_effect)]
|
2016-06-30 01:00:25 +02:00
|
|
|
fn main() {
|
|
|
|
let x = 1;
|
|
|
|
-x;
|
|
|
|
-(-x);
|
2017-02-08 14:58:07 +01:00
|
|
|
--x;
|
2024-05-30 15:54:58 +08:00
|
|
|
//~^ ERROR: `--x` could be misinterpreted as pre-decrement by C programmers, is usually
|
2023-07-28 21:35:48 +02:00
|
|
|
//~| NOTE: `-D clippy::double-neg` implied by `-D warnings`
|
2016-06-30 01:00:25 +02:00
|
|
|
}
|