Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nonminimal_bool can take excessive time #13206

Closed
weaversa opened this issue Aug 2, 2024 · 0 comments · Fixed by #13209
Closed

nonminimal_bool can take excessive time #13206

weaversa opened this issue Aug 2, 2024 · 0 comments · Fixed by #13209

Comments

@weaversa
Copy link

weaversa commented Aug 2, 2024

Description

Here is a source file with a function that computes the value of a small set of clauses on 6 Boolean variables.

$ more src/main.rs 
fn g(a:bool, b:bool, c:bool, d:bool, e:bool, f:bool) -> bool {
    (a && c && f) || (!a && b && !d) || (!b && !c && !e) || (d && e && !f)
}

Running clippy on this file takes ~3 minutes (I believe) due to nonminimal_bool. Many such other Boolean functions cause similar behavior, but here I provide one small example.

$ cargo clippy
    Checking test v0.1.0 (/test)
...
warning: `test` (bin "test") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 2m 46s

I couldn't find another other ticket that exposed this issue, so consider this chiefly something to be aware of. To a lesser extent, I would appreciate knowing if there is a way to turn off the specific clippy feature that is causing the runtime to take so long.

Version

rustc 1.69.0-nightly (5e37043d6 2023-01-22)
binary: rustc
commit-hash: 5e37043d63bfe2f3be8fa5a05b07d6c0dad5775d
commit-date: 2023-01-22
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Additional Labels

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant