mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
13 lines
260 B
Rust
13 lines
260 B
Rust
// run-pass
|
|
|
|
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);
|
|
}
|