]> git.lizzy.rs Git - rust.git/blob - tests/ui/cast/cast-does-fallback.rs
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / ui / cast / cast-does-fallback.rs
1 // run-pass
2
3 pub fn main() {
4     // Test that these type check correctly.
5     (&42u8 >> 4) as usize;
6     (&42u8 << 4) as usize;
7
8     let cap = 512 * 512;
9     cap as u8;
10     // Assert `cap` did not get inferred to `u8` and overflowed.
11     assert_ne!(cap, 0);
12 }