-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Comparison of num::rational::Ratio
is incorrect with overflow
#8466
Comments
It appears Haskell's |
Assuming this can't be fixed in any sane way, one option is to trigger task failure on overflow during comparison (e.g. by using |
No change. (Updated the code example) |
This issue has been moved to the RFCs repo: rust-lang/rfcs#333 |
This issue has been moved to the RFCs repo: rust-num/num#7 |
…nishearth False positive redundant_closure when using ref pattern in closure params fixes rust-lang#8460 Fixed [redundant_closure] so that closures of which params bound as `ref` or `ref mut ` doesn't trigger the lint. (e.g. `|ref x| some_expr` doesn't trigger the lint.) changelog: none
fails the assertion. (It's comparing
128
with1/128
.)This, or something similar, happens for any type that can overflow (I guess one could argue that fixed size types are "unsupported" for rational numbers, and so this overflow leads to unspecified behaviour).
The text was updated successfully, but these errors were encountered: