Open
Description
This is possibly related to #98444
I tried this code:
fn main() {
let x = &-(-127i8 - 1);
}
I expected to see this happen:
error: this arithmetic operation will overflow
--> src/main.rs:3:13
|
3 | let x = &-(-127i8 - 1);
| ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
|
= note: `#[deny(arithmetic_overflow)]` on by default
Instead, this happened: No diagnostic
Meta
Tested on the playground 1.65 and nightly 2022-11-17