Several problems with clippy::manual_is_power_of_two
#14461
Labels
C-bug
Category: Clippy is not doing the correct thing
clippy::manual_is_power_of_two
#14461
Summary
The
manual_is_power_of_two
lint:const
contextReproducer
I tried this code:
I expected to see this happen: either no suggestion, or a suggestion to use
(a as u32).count_ones() == 1
.Instead, this happened:
Not only
.is_power_of_two()
cannot be used in aconst
context below Rust 1.32.0, but also the suggestiona as u32.is_power_of_two()
lacks parentheses arounda as u32
.Version
Additional Labels
@rustbot label +Isuggestion-causes-error
@rustbot claim
The text was updated successfully, but these errors were encountered: