News for hackers. Stuff that matters.
Re:Implementing a NES Emulator in Rust by lmkg on Tuesday March 19, 2019 @01:21PM (#19433021)
The main point is that if you take safe code and put it inside an unsafe block, the meaning of the code doesn't change. So for example, array indexing is bounds-checked in safe code, and non-bounds-checked array access is only available in unsafe blocks. This does not mean that the call `a[i]` loses bounds-checking in an unsafe block. It has the same semantics regardless of context. Rather, the separate call `a.get_unchecked(i)` is available inside an unsafe block and cannot be called in safe code.

There are no comments on this comment yet.