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-07-28 14:35:48 -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
|
|
|
}
|