Re:Rust RAII is better than the Haskell bracket pattern
by steveklabnik on Tuesday October 09, 2018 @09:39AM
(#18175838)
Those semantics would be nice, but they have a lot of unsolved issues: https://gankro.github.io/blah/linear-rust/
Re:Rust RAII is better than the Haskell bracket pattern
by ehsanu1 on Tuesday October 09, 2018 @01:17PM
(#18177834)
Nice article, but not sure that the changes it talks about are actually required for the suggested semantics. The `must_drop` annotation suggested could just be a lint rather than actually being encoded in the type system. I don't know if early drops is related or possible though.
My preferred semantics would have been early drops by default, and a must_drop annotation similar to must_use, to say that objects like RwLockReadGuard should be explicitly dropped or moved.