nonminimal_bool and is_x86_feature_detected #14153
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
T-macros
Type: Issues with macros and macro expansion
Summary
nonminimal_bool
fires when chainingis_x86_feature_detected!()
, suggesting invalid code.Lint Name
nonminimal_bool
Reproducer
I tried this code:
(playground)
I saw this happen:
I expected to see this happen:
I think clippy tries to tell me that
avx2
impliessse4.2
, so there’s no need to specify both. The output is extremely confusing though, and the suggestion is not valid Rust. I think either it should suggest correcting to juststd::is_x86_feature_detected!("avx2")
(although I’m not sure this could be reasonably implemented), or just skip this warning.This reproduces on the latest nightly in Playground. It may be related to #12627, but I’m not sure if it’s a duplicate.
Version
Additional Labels
@rustbot label +I-suggestion-causes-error +T-macros
The text was updated successfully, but these errors were encountered: