diff options
| author | bors <bors@rust-lang.org> | 2024-07-08 15:09:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-08 15:09:45 +0000 |
| commit | dfb92532fadc3cf0dd4b38abad430d8e1e61e8cb (patch) | |
| tree | e82a4d7d4f5e726fcb531c1459414b1edb87f9eb /compiler/rustc_codegen_gcc/example/alloc_example.rs | |
| parent | edc6b00e73116e2d80edd3479458730581b064d4 (diff) | |
| parent | 378962f861ccf98ea33f41dee30282e1ad1c5feb (diff) | |
| download | rust-dfb92532fadc3cf0dd4b38abad430d8e1e61e8cb.tar.gz rust-dfb92532fadc3cf0dd4b38abad430d8e1e61e8cb.zip | |
Auto merge of #12870 - lrh2000:sig-drop-while, r=blyxyas
`significant_drop_in_scrutinee`: Trigger lint also for scrutinees in `while let` and `if let` This lint should also work for `if let` and `while let`, so this PR makes it actually work. For `while let`, I can't think of any reason why this lint shouldn't be enabled. The only problem is that the lint suggests moving the significant drop above the `while let`, which is clearly invalid in the case of `while let`. I don't know if this is fixable, but this PR simply disables the wrong suggestions. For `if let`, it seems that another lint called `if_let_mutex` has some overlapping functionality. But `significant_drop_in_scrutinee` is a bit stricter, as it will trigger even if the `else` branch does not try to lock the same mutex. changelog: [`significant_drop_in_scrutinee`]: Trigger lint also for scrutinees in `while let` and `if let`. r? `@blyxyas` (the third PR as promised in https://github.com/rust-lang/rust-clippy/pull/12740#issuecomment-2094876350, thanks for your review!)
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_example.rs')
0 files changed, 0 insertions, 0 deletions
