3 ms·
I don't know anything about Rust, but is it part of it's "safety" that it has operators to allow rollover of type max size and others that do not? As a C progr
by SlowRobotAhead 8y ago
I don't know anything about Rust, but is it part of it's "safety" that it has operators to allow rollover of type max size and others that do not?
As a C programmer, that sort of feels like cheating ;)
- steveklabnik 8y agoSafety means "memory safety". Integer overflow cannot cause memory unsafety directly, and so it's safe. (safe) Rust does not claim to make your code correct, it claims that it will not have undefined behavior. We do care about helping you make your code correct; it will check for overflow and panic at runtime in debug builds. But it's a secondary concern. Memory safety is hard enough!