News for hackers. Stuff that matters.
Re:Rust for Filesystems by Ygg2 on Monday July 15, 2024 @09:54AM (#40967924)
Yeah, you just renamed `unsafe`.

`unsafe` is the part where the compiler trusts you to uphold your own invariants, necessary to prevent Unsoundness. For example:

- unsafe fn get_unchecked(index) - compiler believes you will ensure index < length.

- unsafe fn set_capacity(capacity) - compiler trusts you will not set capacity to value that will cause UB. Even if its code boils essentially to set a field - which is safe according to Rust, but may invalidate other invariants preserving soundness.

There are no comments on this comment yet.