Closed
Description
When there is an overflowing division or remainder operation that const_prop can detect, the error is duplicated in release mode only:
#![deny(const_err)]
use std::i32;
fn main() {
let _ = i32::MIN / -1;
}
shows
error: attempt to divide with overflow
--> src/main.rs:6:13
|
6 | let _ = i32::MIN / -1;
| ^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![deny(const_err)]
| ^^^^^^^^^
error: this expression will panic at runtime
--> src/main.rs:6:13
|
6 | let _ = i32::MIN / -1;
| ^^^^^^^^^^^^^ attempt to divide with overflow
This is because !overflow_check
is true
in release mode but divison and remainder still get overflow checks.
(This test case already covers the problem, so a fix does not need a new test case, it just needs to adjust the existing test case to no longer expect two ERROR
per line.)