2022-09-21 13:05:20 +02:00
|
|
|
#![deny(arithmetic_overflow)]
|
2022-09-21 13:02:37 -04:00
|
|
|
fn main() {
|
|
|
|
let _x = -1_i32 >> -1;
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: this arithmetic operation will overflow
|
2022-09-21 13:02:37 -04:00
|
|
|
let _y = 1u32 >> 10000000000000u32;
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ 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
|
2022-09-21 13:02:37 -04:00
|
|
|
}
|