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