3 ms·
The good thing out of bounds access in a safe language usually isn’t that they don’t panic. It’s that they do panic instead of returning what happened to be adj
by alkonaut 4y ago
The good thing out of bounds access in a safe language usually isn’t that they don’t panic. It’s that they do panic instead of returning what happened to be adjacent in memory. So v[5] won’t accidentally return w[2] instead.
But out of bounds array access handling isn’t any better in Rust than in other safe languages.
The real benefit of Rust in that scenario is to ensure you don’t access v[0] after freeing v, for example.