|
|
|
|
|
by valarauca1
3890 days ago
|
|
>Requiring that really dilutes the value/meaning of errors. No. You have already diluted the meaning of errors, and you want them elevated to _your_ standard. >Index out of bounds on every array op These are removed if you build a rust program with --release. >Integer overflow on every arithmetic op Add the Wrapping class if you expect overflow. Overflow _shouldnt_ normally happen on an Integer operation. It is a hardware error when it happens, and can cause massive pain-in-ass bugs when it happens unexpectedly. I'd rather get errors when it does happen, rather then find out 6 months into a production run. >OOM on every allocating op C does this also. |
|
Rust doesn't remove bounds checks in --release. It's wrapping that gets turned on in release. I'm not sure why you're distinguishing overflow as truly exceptional, as opposed to any other "this should never happen" error?
Also I don't think many C libraries that allocate expose that as a failure condition (I've certainly seen some which don't even check!)