4 ms·
No. Correctness of code outside unsafe depends on correctness inside those blocks, not the other way around
by iknowstuff 2y ago
No. Correctness of code outside unsafe depends on correctness inside those blocks, not the other way around
- uecker 2y ago[flagged]
- iknowstuff 2y agotf are you talking about
- steveklabnik 2y agoThey are (rudely) talking about https://news.ycombinator.com/item?id=43382369 https://news.ycombinator.com/item?id=43382369
- dwattttt 2y agoIn a more helpful framing: safe Rust code doesn't need to worry about its own correctness, it just is. Unsafe code can be incorrect (or unsound), and needs to be careful about it. Part of being careful is that safe code can call the unsafe code in a way that triggers that unsoundness; in that way, safe code can cause undefined behaviour in unsafe code. It's not always the case that this is possible; there are unsafe blocks that don't need to depend on safe code for its correctness.