blob: fa83d25b3942d5a4f3f4be3ac2cd727dcb64604c (
plain)
1
2
3
4
5
6
7
8
9
|
#![deny(arithmetic_overflow)]
fn main() {
let _x = -1_i32 >> -1;
//~^ ERROR: this arithmetic operation will overflow
let _y = 1u32 >> 10000000000000u32;
//~^ ERROR: this arithmetic operation will overflow
//~| ERROR: literal out of range for `u32`
//~| NOTE: the literal `10000000000000u32` does not fit into the type `u32` whose rang
}
|