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
Possible Incompleteness #293
Comments
Those nested functions do check their conditions right away: num-bigint/src/bigint/power.rs Lines 71 to 79 in e9b204c
num-bigint/src/biguint/power.rs Lines 134 to 138 in e9b204c
How would we avoid the panic? These functions have no other way to communicate such an error. We could add |
I see that you have opened a few similar issues on different projects. In general, it is not considered a problem in Rust if a function panics when documented preconditions are not met -- it means that it is always considered a bug on the caller. |
In num-bigint/src/bigint.rs and num-bigint/src/biguint.rs, I think the code should check modulus != 0 and exponent >= 0/modulus != 0 as comments mentioned before use them to avoid possible panic.
num-bigint/src/bigint.rs
num-bigint/src/biguint.rs
The text was updated successfully, but these errors were encountered: