You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let t = i64::MAX;
assert!(t as u64 > usize::MAX as u64);
When compiling above snippet, clippy complains that:
note: #[warn(absurd_extreme_comparisons)] on by default
help: because usize::MAX as u64 is the maximum value for this type, this comparison is always false
It's true on amd64 platform but not true on i686 platform. Alert on this will assume the code is only compiled and run for amd64 target. And all portable code will need to allow absurd_extreme_comparisons explicitly.
The text was updated successfully, but these errors were encountered:
Since this comparison is useless on 64bit systems, maybe the better solution would be to use some form of cfg to distinguish these cases explicitly. Can you show a real world example?
When compiling above snippet, clippy complains that:
It's true on amd64 platform but not true on i686 platform. Alert on this will assume the code is only compiled and run for amd64 target. And all portable code will need to allow absurd_extreme_comparisons explicitly.
The text was updated successfully, but these errors were encountered: