4 #![deny(exceeding_bitshifts, const_err)]
5 #![allow(unused_variables)]
10 let n = 1u8 << (4+4); //~ ERROR: attempt to shift left with overflow
11 let n = 1i64 >> [63][0];
12 let n = 1i64 >> [64][0]; //~ ERROR: attempt to shift right with overflow
14 #[cfg(target_pointer_width = "32")]
15 const BITS: usize = 32;
16 #[cfg(target_pointer_width = "64")]
17 const BITS: usize = 64;
18 let n = 1_isize << BITS; //~ ERROR: attempt to shift left with overflow
19 let n = 1_usize << BITS; //~ ERROR: attempt to shift left with overflow