nandi/rustnimpublic Fork 0
12c0a01b02392b18af24b583ba4ff65ad040e86a
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.

002-integer-widths.rs · 14 lines · 495 BRust Blame HistoryRaw
Add the differential test runner, and a lowering to measure with it 8ac32af nandithebull 20h ago1// Exact widths must survive the trip. A transpiler that widened these would
2// still print the right answer here, so the wrapping cases below are the
3// ones that actually discriminate.
4fn main() {
5 let a: i8 = -128;
6 let b: u8 = 255;
7 let c: i16 = -32768;
8 let d: u16 = 65535;
9 let e: i32 = -2147483648;
10 let f: u32 = 4294967295;
11 let g: i64 = -9223372036854775808;
12 let h: u64 = 18446744073709551615;
13 println!("{} {} {} {} {} {} {} {}", a, b, c, d, e, f, g, h);
14}