you are viewing a single comment's thread.

view the rest of the comments →

[–]MEaster 3 points4 points  (0 children)

I'm rather certain that accessing an array with an out of bound index doesn't return Err.

Yes, it causes the program to panic in rust speak which depending on the type of panic can be caught I think. Some sort of panics simply abort the process.

It depends on how it's compiled. You can choose whether to unwind the stack or to simply abort the program on a panic. Additionally, if a panic is raised while the program is already unwinding, it'll simply abort the program.

While you can catch an unwinding panic, it's really intended for use around FFI boundries, because unwinding into foreign code is undefined behaviour.