> > Hitting a slow path unexpectedly on overflow seems to me like a recipe > for > > unpredictable performance, which doesn't seem inline with Rust's usual > > goals. > > It's certainly better than the process exiting, which is what's going > to happen in real systems when failure occurs. Either that, or they're > going to lose a bunch of data from the task it caused to unwind. The > only way to make overflow not a bug is to expand to a big integer or > use a big integer from the start. >
IMHO, integer overflow detection should be considered strictly a security feature. I can think of very few cases, when after expansion to a bigint, the program wouldn't have bombed out anyways a few lines later - on some array access or a system API call.
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev