4 ms·
Why? Rust includes index checks by default, so you have zero chance of programmer error. And, to boot, it removes the checks when the compiler decides that the
by jdmichal 10y ago
Why? Rust includes index checks by default, so you have zero chance of programmer error. And, to boot, it removes the checks when the compiler decides that the code is provably safe.
- ue_ 10y agoWhy does Rust still not warn at compile time and furthermore actually crash (panic) on OOB access if it has the checks you describe?
- jdmichal 10y agoI never stated whether the checks were static or runtime. In this case, they are runtime checks. What you are talking about is value range analysis. Rust does a limited amount of it, and if it can prove safe indexing it will remove the runtime checks.
- deleted 10y ago[deleted]