3 ms·
> so an overflowing index variable panics anyway. Unless it overflows all the way to a valid index. Which might lead to unexpected results if the code does not
by cesarb 4y ago
> so an overflowing index variable panics anyway.
Unless it overflows all the way to a valid index. Which might lead to unexpected results if the code does not expect to be using a smaller index (for instance, a code trying to access index i+2 might not be expecting it to suddenly access indexes 0 or 1).
- iudqnolq 4y agoBut Rust is still memory safe because unsafe code "morally" is unsound if it assumes something like that can't happen.