8 ms·
It does, however, have integer overflow, in release mode. So if you do code a conversion, you can end up with a value different from the source.
by ncmncm 6y ago
It does, however, have integer overflow, in release mode. So if you do code a conversion, you can end up with a value different from the source.
- carlmr 6y agoBut that's because Rust designs for zero cost abstractions in release mode. Overflow checking is not zero cost, so it's only enabled in debug mode, which is the maximum safety possible here while keeping it zero cost at (release) runtime. Without dependent types or something similar I don't know if it would be possible to check bounds.
- ncmncm 6y agoYes, there are reasons for it.