summary refs log tree commit diff
path: root/src/test/run-pass/cast-does-fallback.rs
blob: 6adf90fc0e614c52bf2e0998e4e5d1cfd813d91a (plain)
1
2
3
4
5
6
7
8
9
10
pub fn main() {
    // Test that these type check correctly.
    (&42u8 >> 4) as usize;
    (&42u8 << 4) as usize;

    let cap = 512 * 512;
    cap as u8;
    // Assert `cap` did not get inferred to `u8` and overflowed.
    assert_ne!(cap, 0);
}