Re:Rust things I miss in C
by tspiteri on Monday February 19, 2018 @11:41AM
(#16413873)
My mental model of Rust's current overflow behaviour is that "integer overflow is wrapping overflow, but during development it also panics to push me to use explicit wrapping in the code." I'm failing to see how that can qualify as something that "pass[es] the tests but fail[s] in production".
[ Parent
| on HN ]
Re:Rust things I miss in C
by AndrewGaspar on Monday February 19, 2018 @01:18PM
(#16414545)
A pretty reasonable test would be that some function panics on invalid input, in this case by way of integer overflow. This test would pass in a debug build, but could cause unintended, possibly even insecure, behavior in a release build.
Ideally you would run your tests in both debug and release modes, though. :)