6 ms·
Rust needs to add some runtime checks when calling destructors in scenarios where some object may or may not be moved. In C++ for instance, for smart pointers,
by thradams 3y ago
Rust needs to add some runtime checks when calling destructors in scenarios where some object may or may not be moved.
In C++ for instance, for smart pointers, the destructor will have a
"if p!= NULL". Then if the smart pointer was moved, it makes the pointer null and the destructor checks at runtime for it.