Open llogiq opened 8 years ago
shouldn't the type in the example rather be i32
?
if you want the bit pattern in a portable way use nevermind, We're checking the final value...(1usize << 31) as isize
, which is more explicit to your intent
oh well... I still argue it's unportable... but we can split the lint into three, one for enums that implement PartialOrd
, where it still is warn
-by-default, and two for enums that don't implement PartialOrd
(one for values that require more than 32 bit (warn
-by-default), and one for values that will yield different values on 32 bit (allow
-by-default))
You are technically correct (which is after all the best kind of correct :smile:). Still I think it may be useful to split the lint so we can give more relevant report messages.
is okay as long as the specific bit pattern is of the essence; the actual value may vary.
E.g. see https://github.com/ledbettj/wavefile/blob/master/src/speakers.rs#L20