Re:Simple, Fast and Safe Manual Memory Management [pdf]
by oconnor663 on Thursday September 28, 2017 @10:53AM
(#15357510)
> all can cause even Rust programs to fail at runtime
For sure, a safe Rust program can fail in a dozen different ways. My favorite is just creating an unsigned 0 and trying to subtract 1 from it -- in debug mode that'll panic and probably crash the whole program. But unless you touch the `unsafe` keyword, it should be impossible to fail in a way that causes undefined behavior. That's the big difference.
For sure, a safe Rust program can fail in a dozen different ways. My favorite is just creating an unsigned 0 and trying to subtract 1 from it -- in debug mode that'll panic and probably crash the whole program. But unless you touch the `unsafe` keyword, it should be impossible to fail in a way that causes undefined behavior. That's the big difference.
Edit: You're right, I missed the point :| :| :|