Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While you are spot on with zero cost abstractions a bounds check in Rust is not without penalty (if enabled, should be off in release mode)


Bounds checks are always on. Integer overflow checks are disabled in release mode. Bounds checks are necessary for memory safety, whereas integer overflow isn't


I believe release mode keeps bound checks. It's integer overflow checks it gets rid of.


you can't turn bounds checking off.

there are unsafe method for vec that allow you unchecked access to the array, but you need to to write it in unsafe block (some code that is performance sensitive does this).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: