nandi/rustnimpublic Fork 0
99b837678a29fedd20bb68a5117a6621d8d178b4
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.

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