Re:Prusti: Static Analyzer for Rust
by kibwen on Thursday October 13, 2022 @11:48AM
(#33192634)
You can enable (or disable) panic-on-overflow in Rust via a compiler flag or the corresponding value in Cargo.toml: https://doc.rust-lang.org/cargo/reference/profiles.html#over...
[ Parent
| on HN ]
Re:Prusti: Static Analyzer for Rust
by hn92726819 on Thursday October 13, 2022 @11:51AM
(#33192682)
> If not specified, overflow checks are enabled if debug-assertions are enabled, disabled otherwise
Both of the values you can set don't give you a warning though. The linked article is about producing a warning or error when there can possibly be an overflow/panic, which clippy already does.
Edit: here's the lint that warns you that a panic or overflow can be caused: https://rust-lang.github.io/rust-clippy/master/#integer_arit...