Re:Pre-Pooping Your Pants with Rust
by steveklabnik on Monday April 27, 2015 @11:33AM
(#9446934)
Well, it's worth noting that this error happened because unsafe library code relied on a property that wasn't actually true. The language itself is working just fine, Rust cannot and will not prevent all bugs.
[ Parent
| on HN ]
Re:Pre-Pooping Your Pants with Rust
by sirclueless on Tuesday April 28, 2015 @01:54AM
(#9450695)
Scrapping the guarantee that destructors will be called is tantamount to scrapping RAII. thread::scoped made the assumption that destructors were called before a borrowed value was returned, and it led to a memory-safety error. If you don't use unsafe, you won't get memory-safety errors, but you can get plenty of other nastiness.
The guarantee that destructors are called when values leave scope is fantastic. It means that one can leverage memory-safety into arbitrary-resource-acquisition-safety. It violates the principle of least astonishment in a brutal way if Rust's borrow checker can statically guarantee that a value no longer exists, but can't know whether or not its destructor has been called.