2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2019-07-27 00:54:25 +03:00
|
|
|
|
2017-12-21 07:40:54 -02:00
|
|
|
pub fn main() {
|
2018-02-08 17:36:17 -02:00
|
|
|
// Test that these type check correctly.
|
|
|
|
|
(&42u8 >> 4) as usize;
|
|
|
|
|
(&42u8 << 4) as usize;
|
|
|
|
|
|
2017-12-21 07:40:54 -02:00
|
|
|
let cap = 512 * 512;
|
|
|
|
|
cap as u8;
|
|
|
|
|
// Assert `cap` did not get inferred to `u8` and overflowed.
|
|
|
|
|
assert_ne!(cap, 0);
|
|
|
|
|
}
|