rust/tests/compile-fail/overflowing-rsh-2.rs

7 lines
245 B
Rust
Raw Normal View History

#![allow(exceeding_bitshifts, const_err)]
fn main() {
// Make sure we catch overflows that would be hidden by first casting the RHS to u32
2018-10-19 04:50:17 -05:00
let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ ERROR attempt to shift right with overflow
}