nandi/rustnimpublic Fork 0
3d4a7d283b83d3a5305dfc6654c290bd4ee162ae
Commits
Clone
git clone https://git.rickub.com/nandi/rustnim.git
git clone ssh://git@rickub.com/nandi/rustnim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

008-truncating-cast.rs · 11 lines · 375 BRust Blame HistoryRaw
Add the differential test runner, and a lowering to measure with it 8ac32af nandithebull 13h ago1// Rust's `as` truncates; Nim's `T(x)` range-checks. The lowering uses `cast`,
2// which was probed against both compilers.
3fn main() {
4 println!("{}", 300i32 as u8);
5 println!("{}", -1i32 as u32);
6 println!("{}", 200u8 as i8);
7 println!("{}", 65535u16 as i16);
8 println!("{}", -1i64 as u8);
9 println!("{}", 65i32 as f64);
10 println!("{}", true as i32);
11}