3 ms·
True, but pointers don't have destructors in C++ or Rust, I think (and in C, there are no destructors at all, obvs).
by borrowwhatnow 11y ago
True, but pointers don't have destructors in C++ or Rust, I think (and in C, there are no destructors at all, obvs).
- steveklabnik 11y agoThese particular references don't, but many smart pointers do. The borrow checker doesn't currently do something different based on Drop. You can argue that it would be easier if it just made this work, but at the same time, there would be more special cases. Right now, the rule is very simple. We'll see once SEME regions and or non-lexical borrows land, though...