Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do use explicit drop() calls in my own code to call attention to drops with side effects, but it does not seem to be common practice.

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.



Those semantics would be nice, but they have a lot of unsolved issues: https://gankro.github.io/blah/linear-rust/


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: