2018-07-28 10:34:52 -05:00
|
|
|
#[warn(clippy::double_neg)]
|
2021-07-20 22:23:22 -05:00
|
|
|
#[allow(clippy::no_effect)]
|
2016-06-29 18:00:25 -05:00
|
|
|
fn main() {
|
|
|
|
let x = 1;
|
|
|
|
-x;
|
|
|
|
-(-x);
|
2017-02-08 07:58:07 -06:00
|
|
|
--x;
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: `--x` could be misinterpreted as pre-decrement by C programmers, is usuall
|
|
|
|
//~| NOTE: `-D clippy::double-neg` implied by `-D warnings`
|
2016-06-29 18:00:25 -05:00
|
|
|
}
|