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

016-signed-overflow-traps.rs · 9 lines · 311 BRust Blame HistoryRaw
Add the differential test runner, and a lowering to measure with it 8ac32af nandithebull 6h ago1// DESIGN.md item 3, settled: this project models rustc's *debug* profile,
2// where signed overflow panics. Nim's default build traps it too, so the two
3// agree — including on the exit code.
4fn main() {
5 let mut x: i32 = 2147483647;
6 println!("{}", x);
7 x += 1;
8 println!("unreachable {}", x);
9}