mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
ac9dd36856
The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors.
8 lines
113 B
Rust
8 lines
113 B
Rust
#[warn(clippy::double_neg)]
|
|
#[allow(clippy::no_effect)]
|
|
fn main() {
|
|
let x = 1;
|
|
-x;
|
|
-(-x);
|
|
--x;
|
|
}
|