4 ms·
The Rust compiler can eliminate bounds checking anywhere it can prove that it doesn't need it. And beyond that, you always have the option of writing an unsafe
by JoshTriplett 7y ago
The Rust compiler can eliminate bounds checking anywhere it can prove that it doesn't need it. And beyond that, you always have the option of writing an unsafe block, and people sometimes do in carefully selected cases driven by profiling. (That also encourages keeping such code carefully contained and well-scrutinized.)
I'm not arguing that bounds-checking should be mandatory. I'm arguing that bounds-checking should be the default, and you should have to knowingly bypass it, rather than the other way around.