diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-08-23 07:27:07 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-23 07:27:07 +0000 |
| commit | 5ce5b89f403720cab9aec80d28e47ad27c969288 (patch) | |
| tree | 7c4cbb0e17cf933c3c0c02ca9841f1a4935af543 /tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-md5.rs | |
| parent | 55286e796f2e3f549a2c8baa7a64d56bc225ccae (diff) | |
| parent | f0563ade3bdbfa86b7d9f48ad371226b97c22189 (diff) | |
| download | rust-5ce5b89f403720cab9aec80d28e47ad27c969288.tar.gz rust-5ce5b89f403720cab9aec80d28e47ad27c969288.zip | |
extract `bool_comparison` to a separate file (#15499)
For some reason I don't really understand, this lint was mushed together with `needless_bool(_assign)`, even though they seemingly didn't have a lot of overlapping logic -- for one, their lint passes are separate, and can't be merged in a meaningful way. I first wanted to move the file under `booleans/` and move the common logic into `utils.rs`, and then split the files, but it turns out that the entirety of common logic was the `fetch_bool_expr` function, which is literally just `expr.as_literal()?.as_bool()`. So I scratched that idea, moved `bool_comparison` logic to a new file, and copy-pasted the function into it. I think this change is advantageous in two main ways: 1. no confusing intermingling of two different passes' logics 2. the file that defines `clippy::bool_comparison` becomes easier to find, because now there's a file with that name. This PR depends on https://github.com/rust-lang/rust-clippy/pull/15498, but only for easier-rebase purposes. changelog: none
Diffstat (limited to 'tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions
