about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2022-09-02 11:34:45 +0200
committerGitHub <noreply@github.com>2022-09-02 11:34:45 +0200
commit07f43a1ca179c624996b1095a314566733d2e017 (patch)
tree8503e296c06dd2639fde5e86e3146adbbda2ee5d /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentb10aed0084e3fb32b365dba06a1b644c3b0f438b (diff)
parent76c90c3015a7e3ad6f0e6b807839ff59f17eba89 (diff)
downloadrust-07f43a1ca179c624996b1095a314566733d2e017.tar.gz
rust-07f43a1ca179c624996b1095a314566733d2e017.zip
Rollup merge of #97739 - a2aaron:let_underscore, r=estebank
Uplift the `let_underscore` lints from clippy into rustc.

This PR resolves #97241.

This PR adds three lints from clippy--`let_underscore_drop`, `let_underscore_lock`, and `let_underscore_must_use`, which are meant to capture likely-incorrect uses of `let _ = ...` bindings (in particular, doing this on a type with a non-trivial `Drop` causes the `Drop` to occur immediately, instead of at the end of the scope. For a type like `MutexGuard`, this effectively releases the lock immediately, which is almost certainly the wrong behavior)

In porting the lints from clippy I had to copy over a bunch of utility functions from `clippy_util` that these lints also relied upon. Is that the right approach?

Note that I've set the `must_use` and `drop` lints to Allow by default and set `lock` to Deny by default (this matches the same settings that clippy has). In talking with `@estebank` he informed me to do a Crater run (I am not sure what type of Crater run to request here--I think it's just "check only"?)

On the linked issue, there's some discussion about using `must_use` and `Drop` together as a heuristic for when to warn--I did not implement this yet.

r? `@estebank`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions