| ▲ | wasmperson 2 hours ago | |
Now it's your example that's too simple. I can't present a counter-example that wouldn't look totally different: if you avoid the indexing operator then trivially incorrect code like that becomes unrepresentable. It's like if I said destructors help you avoid memory leaks and you asked how you'd avoid a leak in a single-function program that does nothing but call `Box::leak()`. Again: I'm not disputing the fact that the rust index operator does a dynamic bounds check. | ||