rust/tests/ui/numbers-arithmetic/overflowing-lsh-2.rs

10 lines
176 B
Rust
Raw Normal View History

2020-04-16 15:50:32 +09:00
// build-fail
// compile-flags: -C debug-assertions
2022-09-21 13:05:20 +02:00
#![deny(arithmetic_overflow)]
2020-04-16 15:50:32 +09:00
fn main() {
let _x = 1 << -1;
//~^ ERROR: this arithmetic operation will overflow
}