I am writing a crypto library NaCl in pure Rust. Cryptography uses overflow, and all of files in the library need integer overflow to be allowed. I currently have in my
.cargo/config file the following lines:
[build] rustflags = [ "-Z", "force-overflow-checks=off" ]
Without this configuration tests do not run, panicking on overflows
But such setting is not good, as all of my work now has a flag, turning a check off, where it may save me.
Or, when someone clones my repo and tries
cargo test, panics will show. Asking to set a flag that will apply everywhere is sort of impolite
Is there other way to allow integer overflow without changing a global configuration?
Can it be a setting in
Cargo.toml? If yes, how should it look?
Can it be a setting per file with
#![...]? If yes, how should it look?
Thank you in advance.