4 ms·
It is both. "Memory safe" means that if the user is "holding it wrong", it won't cause a memory error. In safe Rust, it is impossible to call free with the wr
by dureuill 3y ago
It is both.
"Memory safe" means that if the user is "holding it wrong", it won't cause a memory error.
In safe Rust, it is impossible to call free with the wrong address (simply by virtue of the `free` equivalent being unsafe, and with the pervasive use of smart pointers to make it practical to stay in safe land).
Similarly even if you "hold it wrong" and use a wrong comparison function in Rust's sort, you might get nonsensical results, but no memory errors.
That's precisely what safety means in this context