3 ms·
Apparently, that doesn't work in Rust: https://news.ycombinator.com/item?id=23363647 https://news.ycombinator.com/item?id=23363647
by mcguire 6y ago
Apparently, that doesn't work in Rust: https://news.ycombinator.com/item?id=23363647 https://news.ycombinator.com/item?id=23363647
- the8472 6y agoIt does work in rust. you just cannot rely on Drop for memory-safety. If you mem::forget a struct that holds onto some other resource then all that means is that you're committing that resource to the lifetime of the process. We usually call that a leak but it can be intentional.
- the_why_of_y 6y agoBy that argument, it doesn't work in C++ either because std::unique_ptr::release() exists.