diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-01-27 04:34:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-27 04:34:50 +0100 |
| commit | c5196736b27a32b688b957f2937dd4affadbe14f (patch) | |
| tree | 9e6396e39e12775699ca2d9c2771f064d5848cf5 /compiler/rustc_codegen_llvm/src | |
| parent | 500614552d91e814ddf5f45ccfe085e00fa9990d (diff) | |
| parent | 25a77cf4f420d2a6fb7863297fab0615f4a4d2e9 (diff) | |
| download | rust-c5196736b27a32b688b957f2937dd4affadbe14f.tar.gz rust-c5196736b27a32b688b957f2937dd4affadbe14f.zip | |
Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercote
Uplift `clippy::double_neg` lint as `double_negations`
Warns about cases like this:
```rust
fn main() {
let x = 1;
let _b = --x; //~ WARN use of a double negation
}
```
The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic.
I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually.
Closes #82987
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
