about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/query.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-01-27 04:34:50 +0100
committerGitHub <noreply@github.com>2025-01-27 04:34:50 +0100
commit3c58b2f7393db863c2ba3b1d286ed3aebd6087c4 (patch)
treeb025ce00a2f28f11655df705f583a6c54ea3580b /compiler/rustc_mir_transform/src/coverage/query.rs
parent0df0662ee06bb8987e0cdbfae5634b1630d41236 (diff)
parentc1dcbebd0b4f721cead9d0f7ad63b88d8effed43 (diff)
downloadrust-3c58b2f7393db863c2ba3b1d286ed3aebd6087c4.tar.gz
rust-3c58b2f7393db863c2ba3b1d286ed3aebd6087c4.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_mir_transform/src/coverage/query.rs')
0 files changed, 0 insertions, 0 deletions