5 ms·
> On the other hand, the Rust code is guaranteed at compile time to be free from buffer overruns No it's not. In this line: .zip(&buffer[i - 12..i]) you
by cousin_it 10y ago
> On the other hand, the Rust code is guaranteed at compile time to be free from buffer overruns
No it's not. In this line:
.zip(&buffer[i - 12..i])
you can just put any indices and it will compile.
- yberreby 10y agoBut it will not read outside of the buffer. It will panic at runtime instead. That's not a buffer overrun.
- AnimalMuppet 10y agoIt's still an error discovered at runtime. It's one that smacks you in the face instead of silently doing the wrong thing, but it's still found at runtime. I really prefer my errors to be found at compile time, but that's often harder to do...